Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: View Help
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
-----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: csvenkata_at_lycos.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jack C. Applewhite INET: japplewhite_at_inetprofit.com 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: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Wed Aug 01 2001 - 08:59:30 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
![]() |
![]() |