Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Public variables
You don't mention a version number.
If you want a variable to be set at the session
logon time - and stay in existence for the duration
of that session, but be invisible to all other sessions
and disappear when the session disconnects, then
the solution under Oracle 8.1 lies in the sys_context
call. Look at 'create context' in the SQL ref manual.
Use a logon trigger to populate the context variables, and refer to them thereafter as
sys_context('context_name','variable_name')
For a searchable set of Oracle manuals online, check http://tahiti.oracle.com
-- Jonathan Lewis http://www.jlcomp.demon.co.uk Host to The Co-Operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html Author of: Practical Oracle 8i: Building Efficient Databases Screen saver or Life saver: http://www.ud.com Use spare CPU to assist in cancer research. Fabio GRANDE wrote in message <9sb97s$mhq$1_at_fe1.cs.interbusiness.it>...Received on Wed Nov 07 2001 - 07:58:54 CST
>Hi all !
>I'm wondering if there's a way to declare public variables in an Oracle
>session.
>I would like to put a value in a variable during the execution of a LOGON
>trigger. This variable (and its value) should be visible to all the
>triggers/procs/functions that the user execute during its work.
>Is this possible ?
>Can someone explain me how I can do this ? (I'd appreciate also a link to
>get some explanation...)
>Thanx in advance
>
>--
>Fabio GRANDE
>f.grandeNOSPAM_at_poker.it
>
![]() |
![]() |