I'm attempting to use the block labels in anonymous blocks and it does not appear to be working out of the box.
Here is some sample code with being the block label of the outer block and referenced within the inner block in a dbms_output call.
declare
l_var number;
l_outer number;
begin
l_outer := 1;
l_var := 1;
dbms_output.put_line('OUTER ANON BLOCK');
dbms_output.put_line('l_var = ' || l_var);
declare
l_var number;
l_inner number;
begin
l_inner := 2;
l_var := 2;
dbms_output.put_line('INNER ANON BLOCK');
dbms_output.put_line('parent.l_var = ' || parent.l_var );
end;
end;
When I attempt to run this code through a SQL Window, I am presented with the following error:
ORA-06550: line 5, column 0:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
* & = - + ; < / > at in is mod remainder not rem
or != or ~= >=
Here is some sample code with being the block label of the outer block and referenced within the inner block in a dbms_output call.
declare
l_var number;
l_outer number;
begin
l_outer := 1;
l_var := 1;
dbms_output.put_line('OUTER ANON BLOCK');
dbms_output.put_line('l_var = ' || l_var);
declare
l_var number;
l_inner number;
begin
l_inner := 2;
l_var := 2;
dbms_output.put_line('INNER ANON BLOCK');
dbms_output.put_line('parent.l_var = ' || parent.l_var );
end;
end;
When I attempt to run this code through a SQL Window, I am presented with the following error:
ORA-06550: line 5, column 0:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
* & = - + ; < / > at in is mod remainder not rem
or != or ~= >=