Re: Forms 4.0: Global versus Parameter Lists
From: Steven P. Muench <smuench_at_oracle.com>
Date: Tue, 14 Dec 1993 04:35:33 GMT
Message-ID: <SMUENCH.93Dec13203533_at_doh.oracle.com>
Date: Tue, 14 Dec 1993 04:35:33 GMT
Message-ID: <SMUENCH.93Dec13203533_at_doh.oracle.com>
AMIN -- There is no *one* right way to use either, but here are some
guidelines that might help you decide:
Datatype: Globals are on CHAR data
Parameters are NUMBER, CHAR, or DATE
Storage: Globals each take about 260 bytes, regardless of length
Parameters take what they need.
Creation: Globals are created the first time they are assigned.
Parameters must be named and typed at design time, or alternately may be added to a parameter list at runtime with the Add_Parameter() built-in. Default: Globals must have a default value programmatically Values assigned. Parameters can be assigned a default value of the proper datatype at design time. Assignment: Globals are assigned directly thru PL/SQL assignment with the bind variable notation (:GLOBAL.GLOBAL_NAME), or indirectly with the Copy() built-in. Parameters in the default parameter list (those created at design time) are assigned directly thru PL/SQL with the bind variable notation (:PARAMETER.PARAM_NAME), indirectly with the Copy() built-in. If part of a parameter list which is not the default parameter list, then the Set_Parameter_Attr() built-in is used. In addition, parameters which are declared at design time can be supplied with values on the command line using the "PARAMNAME=Value" syntax. Reference: Globals can be referenced directly with bind variable notation, or indirectly with the Name_In() built-in. Parameters in the default parameter list may be referenced directly with bind variable notation, or indirectly with the Name_In() built-in. If part of a parameter list which is not the default parameter list, then the Get_Parameter_Attr() built-in is used. Scope: Globals preserve their value for the entire duration of the Runform session, unless explicitly Erased. They are visible to all forms which get called during the session. Any modificaton made in a called form to a global variable is visible to any calling form and all subsequent forms in the session. Parameters are only visible to the form in which they are declared, unless they are passed as part of a parameter list, in which case they supply incoming values for the form-level parameters declared for the called form. The value of the parameter in the callin form is thus visible to the called form in this way. Any modification made in a called form to a parameter is not visible to calling form. The called form gets "fed" a snapshot of the parameter values as they existed at the moment of the Call_Form(), and works with private copies of the values. Documentation: Globals can be created anywhere in any trigger. Unless a Forms developer is disciplined and uses some sort of methodology, globals variables can be very hard to find and document. Parameters exist as named object at the form level, can have meaningful default values, and can be documented with object comments like any other forms object.
-- Steve Muench Email: smuench_at_oracle.com Forms Development CIS: 73404,676 Product Manager Oracle CorporationReceived on Tue Dec 14 1993 - 05:35:33 CET