Using the OUTPUT statement to output NULLs

To have greater compatibility with other software products when extracting data that includes NULL values, you can specify how NULL values appear when using the OUTPUT statement from Interactive SQL.

Prerequisites

You must be the owner of the database or have DBA authority.

Context and remarks

There are two ways to specify how NULL values appear when using the OUTPUT statement from Interactive SQL. Both options allow you to output a specific value in place of a NULL value.

  • the output_nulls option lets you specify the output value used by the OUTPUT statement

  • the IFNULL function lets you apply the output value to a particular instance or query

 Specify a NULL value output (Interactive SQL)
  • Execute a SET OPTION statement that changes the value of the output_nulls option. The following example changes the value that appears for NULL values to (unknown):

    SET OPTION output_nulls = '(unknown)';
 Change the value that appears in place of a NULL value on the Results pane (Interactive SQL)
  1. Click Tools » Options.

  2. Click SQL Anywhere.

  3. Click the Results tab.

  4. In the Display Null Values As field, type Value.

  5. Click OK.

Results

The value that appears in the place of the NULL value is changed to be more compatible with other software.

Next

None.

 See also