In Oracle SQL / PLSQL IS NOT NULL is used to check whether the value of a literal IS NOT NULL or not.
Syntax to use IS NOT NULL in IF statement is:
IF literal_name IS NOT NULL THEN
Here if the literal_name does not have NULL value then the IF condition will evaluate to TRUE, then the “THEN” section of the code will get executed.
Using IS NOT NULL is Oracle SQL / PLSQL SELECT statement:
Suppose we have a table named ‘employee’ as shown below:
Suppose we want to see the records having commission as NOT NULL, then we can achieve the same as:
SELECT * FROM employee WHERE commission IS NOT NULL;
We will get the following results:
Here we can see that we have successfully retrieved records having NOT NULL commission using IS NOT NULL in Oracle SQL PLSQL SELECT statement.