Skip to content

DF_FIELD_IS_NULL

Determines whether a column has the “NULL value”.

Level

Column

Supported by

The DataFlex SQL Drivers (SQL Server, DB2, and ODBC) and the Pervasive.SQL Driver.

Type

Boolean, temporary

Access

Read / Write

Values

  • True
  • False

Syntax

Use cli.pkg
Get_Attribute DF_FIELD_IS_NULL of {tableNumber} {columnNumber} to {BooleanVariable}
Set_Attribute DF_FIELD_IS_NULL of {tableNumber} {columnNumber} to {True|False}

Remarks

This attribute indicates if a column has the "null value". The attribute is true when a field has the null value and false otherwise. Columns can only get the “NULL value” if they are “nullable”. You can query the “nullability” of a column with the DF_FIELD_NULL_ALLOWED attribute.

A null value is a special marker that is used when the value of a column is unknown. You can set this attribute to force a column to have the null value. See "NULL Values and Defaults" for more information.

Example

Procedure CreateRecord
    Begin_Transaction
        Clear MyTable
        Move "UniqueValue"     To MyTable.ID
        Move "SomeOtherValue"  To MyTable.OtherColumn
        Set_Attribute DF_FIELD_IS_NULL Of MyTable.File_Number 3 To True
        SaveRecord MyTable
    End_Transaction
End_Procedure // CreateRecord

The example above creates a new record in table MyTable. It fills two columns with explicit values and gives column number 3 the “NULL value”.