Question:medium

Which of the following is NOT a valid PL/SQL control statement?

Show Hint

While many programming languages use aswitch` statement for multi-way branching, remember that PL/SQL (and standard SQL) uses theCASE` statement for this purpose.
Updated On: Jul 2, 2026
  • IF-THEN-ELSE
  • CASE
  • LOOP
  • SWITCH
Show Solution

The Correct Option is D

Solution and Explanation

Step 1: Recall that different languages use different keywords for the same idea.
Almost every procedural language provides a way to branch based on a condition and a way to repeat a block of code, but the exact keyword used for multi way branching differs from language to language.
Step 2: List what PL/SQL actually offers.
PL/SQL provides IF THEN ELSE and IF THEN ELSIF for conditional branching, CASE statements and CASE expressions for multi way branching, and LOOP, FOR LOOP, and WHILE LOOP for iteration. These are the genuine, documented PL/SQL control structures.
Step 3: Notice the borrowed keyword.
SWITCH is the keyword used for multi way branching in C, C++, Java, and C#, but Oracle's PL/SQL never adopted this keyword, it uses CASE for the same purpose instead. So SWITCH simply does not exist as valid PL/SQL syntax.
Step 4: Conclude.
The construct that is not valid in PL/SQL is
\[ \boxed{\text{SWITCH}} \]
Was this answer helpful?
0