What are Anonymous Blocks in PL/SQL and what are its main features ? Thank you.
There are two kinds of program blocks in PL/SQL, anonymous program blocks and named program blocks. The anonymous ones don't have headers or names and can't be called or referred to specifically but can be used to encapsulate code and limit the scope of declarations or just to provide a block of code where one is syntactically required.
Simplest anonymous block:
begin
null;
end;
/
It doesn't actually do anything. This example from "Oracle Database 11g PL/SQL Programming" by Michael McLaughlin, page 27.
No one has followed this question yet.