Home » Developer & Programmer » Forms » Global variables (Oracle forms 6i, Oracle apps 11i)
Global variables [message #641254] Wed, 12 August 2015 06:54 Go to next message
thelearner
Messages: 133
Registered: April 2013
Location: INDIA
Senior Member
Hi, Am using Global variables in Oracle forms 6i.

for Example
:Global.v_empno:= :EMP.EMPNO;
:Global.v_ename:= :EMP.ENAME;
....


am writing below code in multiple triggers..

if :DEPT.DEPTNO is not null then
:EMP.EMPNO:= :Global.v_empno;
:EMP.ENAME:=:Global.v_ename;
.....

end if;


So I have to reduce this code...
Can anyone help on this to reduce the code...
Re: Global variables [message #641255 is a reply to message #641254] Wed, 12 August 2015 06:59 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What do you mean by "reducing" that code? Reduce how? If you have to set items to those global variables' values, then you have to do that - you can't reduce anything.

Though, you could create procedures: for example, call one of them SET_GLOBALS and put your first code into it. Another one would be USE_GLOBALS and contain your second code. Then you'd just call those procedures in all the triggers (instead of typing the whole IF ... END IF).
Re: Global variables [message #641256 is a reply to message #641254] Wed, 12 August 2015 06:59 Go to previous message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Put the code in a procedure, call the procedure from the triggers
Previous Topic: Add column to a existing form
Next Topic: view based datablock
Goto Forum:
  


Current Time: Thu Apr 18 21:24:16 CDT 2024