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: Variables accessible to all sessions in pl/sql?

Re: Variables accessible to all sessions in pl/sql?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 17 Dec 1999 08:14:25 -0500
Message-ID: <emdk5s4apqf2p09o5356p5vckl4fbb0an4@4ax.com>


A copy of this was sent to Njål Ekern <n.a.ekern_at_usit.uio.no> (if that email address didn't require changing) On Thu, 16 Dec 1999 12:07:53 +0100, you wrote:

>
>Hi!
>
>We have a system with a lot of pl/sql packages. We are running Oracle
>8.0.6
>The possibility of having persistent global variables in the package
>specification available to the user throughout his/hers session is very
>useful. But now we want something 'more general'. We want all users to
>have access to the same variables and their values, not having their own
>private set.
>
>I.e. we want the db-startup-script to call a pl/sql procedure. The
>procedure will do some complicated and time-consuming estimations, and
>then we want it to store the results in some variables that will be
>readable for every user session.
>

this mechanism is called a table :)

create table shared_vars ( var_name varchar2(...) primary key, var_value varchar2(....) );

there is no mechanism to share a single package instance across all sessions.

>Are there any solutions for this kind of sharing variables between
>sessions?
>
>We have looked at packages with Pragma 'serially reusable'. Here the
>variables are stored in the SGA and initialised every time the package
>is called. We want something like a package stored in the SGA which are
>initialised once and then all the variables in the package and their
>values can be read by pl/sql-programs ran by any session.
>
>Are there any solutions for this? Any ideas will be appreciated!
>
>Regards, Njål
>n.a.ekern_at_usit.uio.no

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Dec 17 1999 - 07:14:25 CST

Original text of this message

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