In a PL/SQL block structure, which parts are optional?
-
a) DELCARE and BEGIN
-
b) DECALRE and EXCEPTION
-
c) EXCEPTION and END
-
d) BEGIN and END
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.