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;

 

PL/SQL Named Program Unit in Oracle

Different Types of PL/SQL Code Blocks in Oracle

Understanding PL/SQL Language Basics

⇑⇑ Oracle Database Tutorials

2018-11-29, 1648🔥, 0💬