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: global variables

Re: global variables

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sat, 12 Jun 1999 15:49:48 GMT
Message-ID: <37648129.4756088@newshost.us.oracle.com>


A copy of this was sent to Dan Hess <dah23_at_cornell.edu> (if that email address didn't require changing) On Fri, 11 Jun 1999 20:48:59 -0400, you wrote:

>I'm sure this is basic, but how can I declare global variables to
>persist outside of blocks, just as tables do?
>
>For example, how would I declare a counter variable containing the
>number of times a table is accessed, that has the same accessability as
>the table?
>
>Thanks a million,
>Dan

sounds like you are trying to have 'persistant' variables -- ones that would survive a logout or reboot.

if so, the data needs to be in a table. global package variables are local to a session. no other session will see some other sessions variables and when you log out -- their values are gone.

if you need something permanent, you need to use a database object. If you just need a counter -- look at a sequence (start with 1 increment by 1 nocache -- they make a very easy hit counter)

See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'... Mirrored (and more current) at http://govt.us.oracle.com/~tkyte/

Current article is "Fine Grained Access Control", added June 8'th  

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 Sat Jun 12 1999 - 10:49:48 CDT

Original text of this message

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