|
|
Re: global vs parameter [message #395772 is a reply to message #395234] |
Thu, 02 April 2009 09:45 |
marvSQL
Messages: 13 Registered: February 2008 Location: JAMAICA
|
Junior Member |
|
|
Oracle does not really provide any way to declare global variables...well they get declared when you assign a value to them for example:
IF HAVE 2 FORMS :FORMA AND FORMB
IN FORMA
if i wanted to create a global variable called my_global_var and set it to 'hello' i would do somthing like this
:global.my_global_var := 'hello' ;
this variable will be visible by the forms within the current session and only within the current program.
IN FORMB
so if i have FORMB has a textbox called display,and i wanted to let the texbox value to show the value of the global variable the i would do somthing like this:
:display := :global.my_global_var ;
if i wanted to pass the same 'hello' by parameter and the name of the parameter is my_param_var then i would have to
IN FORMA
1.create a Parameter List (see help for Create_Parameter_List) .
2.add the parameter to the list useing Add_Parameter(see help for Add_Parameter) .(nb. the parameter name is my_param_var)
3.pass the parameter list and the called form to CALL_FORM built in.(see help for CALL_FORM )
IN FORMB (the form getting the parameter)
1. create the parameter with forms builder(nb the name of the parameter must be the name of the one passed by FORMA so it must be called my_param_var)
so if i have FORMB has a textbox called display,and i wanted to let the texbox value to show the value of the parameter the i would do somthing like this:
:display := :PARAMETER.my_my_param_var;
[EDITED by LF: removed superfluous empty lines]
[Updated on: Thu, 02 April 2009 15:22] by Moderator Report message to a moderator
|
|
|
|
|