Name

SET NULL

Synopsis

The NULL setting changes the text SQL*Plus prints in a column when the value for that column is null.

Syntax

SET NULL null_text

Parameters

null_text

Is the text you want to print in place of a null value.

Examples

The default null text setting is an empty string, which causes null values to print as blanks. The following example shows this and shows how the null text may be changed:

SQL> SELECT employee_termination_date
  2    FROM employee
  3   WHERE employee_id=101;
EMPLOYEE_
---------
SQL> SET NULL "*NULL*"
SQL> SELECT employee_termination_date
  2    FROM employee
  3   WHERE employee_id=101;
EMPLOYEE_
---------
*NULL*

If you use the COLUMN command to format a column, the NULL clause of that command will override this setting but only for that one column.

Get Oracle SQL*Plus: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.