Home » SQL & PL/SQL » SQL & PL/SQL » Global variable (oracle 6i)
Global variable [message #623082] Thu, 04 September 2014 03:33 Go to next message
HARSHAL.HVJ
Messages: 1
Registered: September 2014
Location: mumbai
Junior Member

how to declare a global variable and use it different triggers?
Re: Global variable [message #623083 is a reply to message #623082] Thu, 04 September 2014 03:43 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Welcome to the forum!

Please read and follow the OraFAQ Forum Guide and How to use [code] tags, to enable us to help you.

Are you really on version 6i? Please explain in details what exactly you are trying to do.
Re: Global variable [message #623084 is a reply to message #623083] Thu, 04 September 2014 03:44 Go to previous messageGo to next message
cookiemonster
Messages: 13922
Registered: September 2008
Location: Rainy Manchester
Senior Member
Do you mean forms 6i?
If so have you read the form builder help topics on global variables?
Re: Global variable [message #623087 is a reply to message #623084] Thu, 04 September 2014 04:14 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Shortly, there are two common ways to do that. One is to simply
:global.ename := 'SCOTT';
and the other one uses the following built-in:
default_value('SCOTT', 'global.ename');


How to use them in triggers? Just like any other variables - just make sure to precede their names with ":global.", such as
declare
  l_ename    emp.ename%type   := :global.ename;


For some more info, do what Cookiemonster suggested (i.e. read Forms Help).
Re: Global variable [message #623090 is a reply to message #623082] Thu, 04 September 2014 05:39 Go to previous message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

And if you mean in SQL or PL/SQL then use a package variable or a context one.

Previous Topic: how to create database link
Next Topic: Problem while Modifying column data type
Goto Forum:
  


Current Time: Fri May 10 04:50:02 CDT 2024