Collections:
Test NULL Values in Oracle
How To Test NULL Values in Oracle?
✍: FYIcenter.com
There ate two special comparison operators you can use on NULL values:
The following sample script shows you examples of comparing NULL values:
DECLARE
next_task CHAR(80);
BEGIN
next_task := NULL;
IF next_task IS NOT NULL THEN
DBMS_OUTPUT.PUT_LINE('I am busy.');
ELSE
DBMS_OUTPUT.PUT_LINE('I am free.');
END IF;
IF next_task IS NULL THEN
NULL;
ELSE
DBMS_OUTPUT.PUT_LINE('... working on ' || next_task);
END IF;
END;
Note that "variable = NULL" is not a valid operation. This script should print this:
I am free.
⇒ Creating Oracle PL/SQL Procedures and Functions
⇐ What Is NULL in PL/SQL in Oracle
2018-07-13, 2505🔥, 0💬
Popular Posts:
What are DDL (Data Definition Language) statements for tables in SQL Server? DDL (Data Definition La...
What Happens to Your Transactions When ERROR 1213 Occurred in MySQL? If your transaction receives th...
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...
How To Drop a Stored Procedure in Oracle? If there is an existing stored procedure and you don't wan...
How to execute statements in loops in SQL Server Transact-SQL? How to use WHILE ... loops? You can u...