Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: global variables
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--