Multiple choice technology databases

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

  1. a) DELCARE and BEGIN

  2. b) DECALRE and EXCEPTION

  3. c) EXCEPTION and END

  4. d) BEGIN and END

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

In PL/SQL block structure, only the EXECUTE section is mandatory. DECLARE (for declarations) and EXCEPTION (for exception handling) are both optional. BEGIN marks the start of the executable section and is required. END marks the end of the block and is required. Therefore, both DECLARE and EXCEPTION can be omitted in a simple PL/SQL block.