Venkata,

Yes.
Create a public variable in a PL/SQL package stored in the database.
Reference that public variable in the where clause of your view and populate
that variable before you select from the view.  Since each session gets its
own instantiation of the packaged variable, each session uses a "customized"
version of the view.  It's a handy technique!

BTW, create the variable with a default value (Null or some "real" value)
such that the view will work as desired even if the variable is not
explicitly assigned a value.

Jack

--------------------------------
Jack C. Applewhite
Database Administrator/Developer
OCP Oracle8 DBA
iNetProfit, Inc.
Austin, Texas
www.iNetProfit.com
[EMAIL PROTECTED]
(512)327-9068


-----Original Message-----
Subramanian
Sent: Wednesday, August 01, 2001 8:22 AM
To: Multiple recipients of list ORACLE-L


Dear All,
Is it possible to create a view where I will pass the condition to the where
clause dynamically.

eg)
Create view v1 as select ename,empno,sal from emp where deptno=:a

The value of 'a' I will pass the value dynamically when I do the select.

eg) select * from v1.
Now I'll pass the value  say 20.

Is this possible

Any suggestions or workaround for this.

TIA

Regards

Venkata


Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: C.S.Venkata Subramanian
  INET: [EMAIL PROTECTED]


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jack C. Applewhite
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to