Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Parameterized Views
"Brian Kramer" <bug0926_at_yahoo.com> wrote in message news:41d6bfd4.0308130423.6dcee641_at_posting.google.com...
> In a nutshell we have the userid in a web application and we need a
> way to get it to the database so a view can be created that filters
> based on the userid.
Build a stored PL/SQL function that accepts the userid as a parameter and builds the SQL dynamically, adding the userid as a bind variable. Open a REF CURSOR with the SQL string and return it. It's in the PL/SQL manual how to do this. Call the function from the web application using CallableStatement or similar interface, passing the userid. CallableStatement works from both JDBC and ODBC.
HTH
-- Cheers Nuno Souto wizofoz2k_at_yahoo.com.au.nospamReceived on Wed Aug 13 2003 - 07:55:22 CDT