Wednesday, June 17, 2015

 Oracle Form Global Variable Recognition

In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,

Global Variable
·        Global variables has a global scope; it is visible (accessible) throughout your application program.
·        Global variables are used extensively to pass information between forms.
·        Global variables can be created by a PL/SQL assignment, or by the DEFAULT_VALUE built-in.

Global Variable Types
Oracle Forms Developer and PL/SQL support different types
  • Oracle Forms Global: a variable in the "global" pseudo-block of a form
  • PL/SQL Package Global: a global defined in the specification of a package
  • Oracle Forms Parameter: a variable created within the Oracle Forms Designer as a Parameter

Pls. see the Oracle Forms Reference Manual for a complete description of these variable types.
 The following table lists the characteristics of each type of variable, and enables you to select the type most appropriate for your code.
Oracle Forms Global
PL/SQL Package Global
Oracle Forms Parameter
Can be created at Design time

Can be created at runtime

Accessible across all forms

Accessible from attached libraries
Support specific data types
Have declarative defaults

Can be referenced indirectly

Can be specified on command line

Must be erased to recover memory

Can be used in any Oracle Forms code


Global Variable Limitations  

·        Global variables do not generate any compilation errors during development stage but only run-time errors.

·        Global variables are always characters. If you are not familiar with this fact, your expected output will not work; no effect.

       Now Current situation

§    On development stage, at design-time, you will not face any compilation error.
§   On test stage, at run-time you will not face any run-time error.
        You will have  just silent failure with no explanation and sucked helpless. It's                 better to know this case before wasting effort and time.

·     A significant drawback of Global variables; it consumes high memory resources:
§  Memory is an important resource for your application so it’s wise to consider choosing other alternatives for Global variables.
§   Form Parameters are recommended alternative instead of using Global variables.

·     Global variables usage is recommended Not to use them if un-necessary.

·     Global variables persist in memory until you remove it externally with the ERASE () built-in procedure.

·     Global variables must be declared, if Not initialize before execution, it will generate run-time error.

FRM-40815 GLOBAL. does not exist.

              Warning Avoid above error by assigning the appropriate value to                                             the global variable before opening the new form.

·        In fact, they are usually considered bad practice precisely because of their non-locality.

·     Each Global variable Must has the same name to each form session.

          Warning: Oracle recommends explicit conversions, rather than rely on                                         implicit or automatic conversions for these reasons:

·        You will need   using a NUMBER using the TO_NUMBER() function or using TO_DATE() functions. 


  For more related detailed Global variables usage pls read 

Hope this helps…

My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.