The IF statement in PL/SQL is used to check the specific condition before execute single or block of statements only when condition is TRUE. PL/SQL allows you to write programming language features like IF statement to make your code decision making. If the condition is "true" then block will be executed, otherwise block will not be executed.
To check a specific condition before execute block statements only when condition is TRUE, use the following syntax:
To check a specific condition before execute block statements only when condition is TRUE, otherwise execute other block statements if condition is FALSE, use the following syntax:
To check a multiple conditions, if condition1 is TRUE execute block statement for contition one, otherwise execute other block statements for contition two, if condition2 is TRUE, use the following syntax:
To check a multiple conditions, if condition1 is TRUE execute block statement for contition one, execute other block statements for contition two, if condition2 is TRUE otherwise execute other block statement if condition1 and condition2 are FALSE, use the following syntax: