Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Parameterized Views

Re: Parameterized Views

From: Ryan <rgaffuri_at_cox.net>
Date: Wed, 13 Aug 2003 19:39:04 -0400
Message-ID: <k0A_a.15306$ug.10819@lakeread01>

"Connor McDonald" <connor_mcdonald_at_yahoo.com> wrote in message news:3F3A5434.518_at_yahoo.com...
> Brian Kramer wrote:
> >
> > Does oracle support parameterized views? Basically we'd like to be
> > able to pass a userid to a view and based on the userid filter the
> > data.
> > We can get the userid into a table but the problem is that we don't
> > know which user id goes with which request (we are using a common
> > application login, rather than separate user logins). Is there such a
> > thing as a temporary table for a given session? Or some other way to
> > guarantee we are pulling the correct userid?
> >
> > 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.
>
> check out the use of contexts and the SYS_CONTEXT function to do this.
>
> create view view_on_emp
> as select * from emp
> where empno = sys_context('MYCTX','EMPNO);
>
> dbms_session.set_context('MYCTX','EMPNO',12);
> select * from view_on_emp;
>
> hth
> connor
>

what is the difference between set_context and dbms_rls? They look to serve the same purpose?

> --
> =========================
> Connor McDonald
> http://www.oracledba.co.uk
>
> "Some days you're the pigeon, some days you're the statue"
Received on Wed Aug 13 2003 - 18:39:04 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US