PL/SQL Anonymous Block in Oracle

Q

What Is an Anonymous Block in Oracle?

✍: FYIcenter.com

A

An anonymous block is a PL/SQL code block with no name. It consists of three parts:

  • Declaration Part - Defining local variables and local procedures. Declaration part is optional.
  • Execution Part - Defining execution logic with executable statements. Execution part is required.
  • Exception Part - Defining error handling logics. Exception part is optional.

Here how a complete anonymous block should look like:

DECLARE 
  -- Declaration statements
BEGIN
  -- Executable statements
EXCEPTION
  -- Error handling statements
END;

 

Understanding PL/SQL Language Basics

⇒⇒Oracle Database Tutorials

2016-10-17, 179👍, 0💬