Part 33 global variable & erase global variable
description
Transcript of Part 33 global variable & erase global variable
![Page 1: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/1.jpg)
Dr.Girija narasimhan 1
Part 33- global variable
&
Erase global variable
![Page 2: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/2.jpg)
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 variablesRather, you initialize a global variable the first time you assign a value to it
![Page 3: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/3.jpg)
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’);
![Page 4: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/4.jpg)
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
![Page 5: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/5.jpg)
Dr.Girija narasimhan 5
Erase global variable
Erase(‘global.web’);
Remove global variable and release its memory by using 'ERASE' Build-in procedure
![Page 6: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/6.jpg)
Dr.Girija narasimhan 6
![Page 7: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/7.jpg)
Dr.Girija narasimhan 7
![Page 8: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/8.jpg)
Dr.Girija narasimhan 8
![Page 9: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/9.jpg)
Dr.Girija narasimhan 9
![Page 10: Part 33 global variable & erase global variable](https://reader036.fdocuments.in/reader036/viewer/2022082808/556355afd8b42a6f7b8b565e/html5/thumbnails/10.jpg)
Dr.Girija narasimhan 10