Collections:
Use "IF" Statements with Multiple Conditions in Oracle
How To Use "IF" Statements on Multiple Conditions in Oracle?
✍: FYIcenter.com
If you have multiple blocks of codes to be executed based on different conditions, you can use the "IF ... ELSIF" statement. Here is a sample script on IF statements:
DECLARE
day VARCHAR2;
BEGIN
day := 'SUNDAY';
IF day = 'THURSDAY' THEN
DBMS_OUTPUT.PUT_LINE('Checking log files.');
ELSIF day = 'TUESDAY' THEN
DBMS_OUTPUT.PUT_LINE('Helping developers.');
ELSIF day = 'FRIDAY' THEN
DBMS_OUTPUT.PUT_LINE('Rebuild indexes.');
ELSE
DBMS_OUTPUT.PUT_LINE('Reading some papers.');
END IF;
END;
This script should print this:
Reading some papers.
⇒ Use "WHILE" Loop Statements in Oracle
⇐ Types of Execution Flow Control Statements in Oracle
2018-07-13, 2613🔥, 0💬
Popular Posts:
Where to find answers to frequently asked questions on Storage Engines: MyISAM, InnoDB and BDB in My...
How to obtain the number of rows found by the last SELECT statement using the FOUND_ROWS() function?...
How To Change the Name of a Database User in SQL Server? If you want to change the name of an existi...
How To Connect ASP Pages to Oracle Servers in Oracle? If you are running Windows IIS Web server and ...
How To Download Oracle Database 10g XE in Oracle? If you want to download a copy of Oracle Database ...