PL/SQL includes procedural language elements such as conditions and loops. It allows declaration of constants and variables, procedures and functions, types and variables of those types, and triggers. It can handle exceptions (runtime errors). Arrays are supported involving the use of PL/SQL collections. Implementations from version 8 of Oracle Database onwards have included features associated with object-orientation. One can create PL/SQL units such as procedures, functions, packages, types, and triggers, which are stored in the database for reuse by applications that use any of the Oracle Database programmatic interfaces.
The IF-THEN-ELSIF statement allows you to choose between several alternatives. An IF-THEN statement can be followed by an optional ELSIF…ELSE statement. The ELSIF clause lets you add additional conditions.
When using IF-THEN-ELSIF statements there are few points to keep in mind.
It’s ELSIF, not ELSEIF
An IF-THEN statement can have zero or one ELSE’s and it must come after any ELSIF’s.
An IF-THEN statement can have zero to many ELSIF’s and they must come before the ELSE.
Once an ELSIF succeeds, none of the remaining ELSIF’s or ELSE’s will be tested.
Subscribe to our Channel for more videos