Multiple choice technology databases

In a PL/SQL block structure, which parts are optional?

  1. DELCARE and BEGIN

  2. DECALRE and EXCEPTION

  3. EXCEPTION and END

  4. BEGIN and END

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In a PL/SQL block, only the BEGIN and END sections are mandatory. The DECLARE section (where variables, cursors, and types are defined) is optional if you don't need to declare anything. The EXCEPTION section (error handling) is also optional if you don't need specific exception handlers. A minimal block can be just BEGIN-END.