PL/SQL [message #226662] |
Mon, 26 March 2007 02:24 |
kr_arvind
Messages: 85 Registered: April 2006 Location: Delhi
|
Member |
|
|
Hi,
How can fatch the main block variable in subblock without change the variable name.
Is it possible if possible then please help me
declare
x number :=10;
y number;
begin
declare
x number:=5;
begin
y:=x+x;
dbms_output.put_line(y);
end;
end;
OUTPUT
y=15
Thanks
Arvind
|
|
|
Re: PL/SQL [message #226664 is a reply to message #226662] |
Mon, 26 March 2007 02:30 |
dhananjay
Messages: 635 Registered: March 2002 Location: Mumbai
|
Senior Member |
|
|
hi,
one of the way to do the same.
<<outer>>
declare
x number :=10;
y number;
begin
declare
x number:=5;
begin
y:=outer.x+x;
dbms_output.put_line(y);
end;
end;
regards,
|
|
|
|
|
|
|
|
|