2. Dr.Girija narasimhan 2
A global variable is a Oracle Forms variable whose
value is accessible to triggers and subprograms in
any module that is active during the current
session.
In Oracle 10g forms you can store up to 4000
BYTES of CHAR data, while in previous version it
was limited to 255 BYTES CHAR only.. Global
variables are not formally declared the way
PL/SQL local variables
Rather, you initialize a global variable the first
time you assign a value to it
3. Dr.Girija narasimhan 3
:global.web:=www.goodwill.com;
Before the variable the colon with global to be added and dot
(.) variable name and then assign the value.
You can use the DEFAULT_VALUE built-in procedure to assign
a value to a variable whose value is NULL.
If the value of the indicated variable is not NULL,
DEFAULT_VALUE does nothing.
If the variable to which the value is being assigned is an
undefined global variable, Oracle Forms creates the variable.
Default_value(www.goodwill.com,global.web);
4. Dr.Girija narasimhan 4
:GLOBAL.my_var := TO_CHAR(:order.total * .85);
calculate_discount(TO_NUMBER(:GLOBAL.my_var));
The DATATYPE for global variable is always CHAR. So if you are
assigning DATE, NUMBER data to global variable and reassigning
these global values to any other variable having Data type other
than CHAR, there is always overhead of implicit data-type
conversion
:GLOBAL.ur_globalvar := TO_CHAR(15);
:GLOBAL.ur_globalvar:= '15';
:GLOBAL.ur_globalvar := 15;
or
or
5. Dr.Girija narasimhan 5
Erase global variable
Erase(global.web);
Remove global variable and release its memory by
using 'ERASE' Build-in procedure