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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Public variables

Re: Public variables

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 7 Nov 2001 13:58:54 -0000
Message-ID: <1005141397.22912.1.nnrp-08.9e984b29@news.demon.co.uk>

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>...

>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
>
Received on Wed Nov 07 2001 - 07:58:54 CST

Original text of this message

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