Predefined Variables for Expressions

In addition to using column names, literals, operators, and functions in an expression, you can use predefined variables that have defined meanings or values. For example, you can use a predefined variable to display the user name for the current user or to search for data columns that contain no value (null).

The list below includes examples of predefined variables.

Predefined Variable Description Example
CURRENT_USER The user name of the current user
UPDATE accounts 
SET salesperson = CURRENT_USER
WHERE region = 'NW'

Changes the salesperson column for all accounts in the northwest region to the name of the current user.

NULL A null value, used in the search expressions
IS NULL and
IS NOT NULL
SELECT emp_id, lname, fname, minit
FROM employee
WHERE minit IS NULL

Finds authors who have no middle initial.

Note   The keyword IS is a special operator for use with NULL.