Home » Developer & Programmer » Forms » Package variables are nullified during session
Package variables are nullified during session [message #87131] Wed, 08 December 2004 07:37 Go to next message
YuliaG
Messages: 8
Registered: June 2003
Junior Member
Hi,
In my package I use a public variable (G_MY_VARIABLE):

CREATE OR REPLACE PACKAGE my_package AS
G_MY_VARIABLE &ora_aq_user..MY_TABLE.MY_FIELD%TYPE := 0;
...

It is initialized (by a non-zero value) in one stored procedure of this package and then - used by another.
At some point G_MY_VARIABLE is nullified at client's site. I set it to zero in my code only at the package creation and make sure it was set with a NON-zero number.
The worst is that I cannot reproduce it at development environment!!!

I was told that ORACLE sometimes erases least-recently-used variables, when its cache is overfilled.
I also tried:
 alter system flush shared_pool;
in order to immitate it but this didn't nullify it.

Please, help me to understand how package variables can be nuliffied, so I can reproduce it!
Thanks in advance,
Yulia
Re: Package variables are nullified during session [message #87156 is a reply to message #87131] Fri, 10 December 2004 12:16 Go to previous message
Just John
Messages: 69
Registered: November 2004
Member
There is a similar question on another forum.

It appears that the &variable is stored when the package is compiled.

You really should not be &variable in any database stored object. Just pass the required variable in at run time and you will not get the issue...

CREATE OR REPLACE PROCEDURE test (variable varchar2) AS
.........

OK?
Previous Topic: clear the text item and place on other control
Next Topic: get current value
Goto Forum:
  


Current Time: Thu Sep 19 05:51:28 CDT 2024