PLSQL : Nested Block Example
declare
l_main_block varchar2(100) := 'MAIN_BLOCK';
begin
dbms_output.put_line('Main Block:'||l_main_block);
dbms_output.put_line('Nested Block inside min Block:'||l_nested_block);
----------------------------Nested block---------------
declare
l_nested_block varchar2(100) := 'NESTED_BLOCK';
begin
dbms_output.put_line('nested Block:'||l_nested_block); --to write another business logic
dbms_output.put_line('Main Block inside nested Block:'||l_main_block);
end;
---------------------------end -Nested block---------------
exception when others then
dbms_output.put_line('Error:'||SQLERRM);
end;
No comments:
Post a Comment