PL/SQL 在程式語法中對於狀態的判別有兩個語法可作判別:IF 與 CASE 語法 (statements):
IF statements 語法使用方法有下列幾個方式:
IF-THEN Statement
IF condition THEN
sequence_of_statements
END IF;
IF-THEN-ELSE Statement
IF condition THEN
sequence_of_statements1
ELSE
sequence_of_statements2
END IF;
IF-THEN-ELSIF Statement
IF condition1 THEN
sequence_of_statements1
ELSIF condition2 THEN
sequence_of_statements2
ELSE
sequence_of_statements3
END IF;
IF-THEN-ELSE 的例子