Global variable [message #194717] |
Sun, 24 September 2006 23:31 |
monasingh
Messages: 229 Registered: May 2006 Location: Mumbai
|
Senior Member |
|
|
Hi,
I have to declare a global variable.
Can you please let me know if the below statement is correct way of creating a Global variable.
VARIABLE basedate DATE := TRUNC(SYSDATE,'DAY');
Thanks,
Mona
[Updated on: Mon, 25 September 2006 00:00] Report message to a moderator
|
|
|
|
|
|
Re: Global variable [message #194744 is a reply to message #194733] |
Mon, 25 September 2006 01:23 |
Liza79
Messages: 74 Registered: September 2006
|
Member |
|
|
ya thats right, what EXECUTE statement does, it just build an internal pl/sql block and put your command inside it, so your statement is actually being executed like this.
BEGIN
:g_basedate := TO_CHAR(TRUNC(SYSDATE,'DAY'),'MM/DD/RRRR');
END;
/
So it is working, like i already said that it will work in PL/SQL.
Liza
|
|
|