views:

61

answers:

3

Hello,

Do I suppose correctly that it is not possible to create view with parameters?

I've got a query with sub-query and in its where clause I need to specify parameter. Specifying where clause of view would not help. I would like to call simple view with parameters instead of the sending to the database complicated sql query. How would it be possible to do this?

N.

A: 

You should be able to use a table-valued function.

Kendrick
+6  A: 

You mention "specifying where clause of view would not help". Why not? My advice is to just create a view without the parameters, and use a "select * from view where [your predicates with your parameters]".

If you really want to continue with parametrized views, then you can use application contexts in your where clause. You can read about them here in the documentation: http://download.oracle.com/docs/cd/E11882_01/network.112/e10574/app_context.htm#DBSEG011

And here is an example.

Regards, Rob.

Rob van Wijk
A: 

Thank you for advices, I've used table-valued function

noo
Note that you can accept an answer by clicking the check box beside it. You should also upvote any answers you found useful.
Kendrick