Why would you create a view within a stored proc? Do you also delete it when you are done? A view should be a fairly stagnant object that is used by multiple processes/users/etc... Looks like all you are doing is adding the WHERE clause to your 'view'. A view can exist joining many tables together and having different criteria, then in your SQL against that view you can add a where clause to further filter your view. For instance in your case:
create view my_view
as select these_concatenated_columns
Then you would have SQL like:
select * from my_view
where these_condition = those_columns
Also, as an aside for your performance get away from the select from sysdummy statements. Just use the SET :hostvar = ? You are already using it for some, use it for the rest of those variables, it is >30% cheaper to do so.
Actually i have millions of data stored in that table. now i want only few months data that is in probably in thousands. so i am using View because there are some restrictions that i cant use global temp table. so is there anything i can do for that ??
yes, seriously do as I stated. Create a view that always exists, talk to your DBA team about it. Then query your view for the date range you want. or run the desired SQL. Either way is the same. A view is not a materialized resultset. A view is just a definition of how to get to the data that you want to access then you can put additional filtering criteria on the view when you query it.