Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This section described the behavior of SQL Null fields in

The following field definitions are used throughout the text:

...

*SQLNULL Keyword
Intrinsic Property .IsSqlNull
Intrinsic Method .AsValue

Anchor
Conditions
Conditions
Conditions

  • To test for SQL Null, you should use *IS *SQLNULL or *ISNOT *SQLNULL, or the Intrinsic Property .IsSqlNull.
  • When using IF_NULL or .IsNull, an SQL Null field will return FALSE.
  • Since SQL Null does not represent a value, when using an equality operator such as *EQ, *LE, *GT to compare fields, and one of the factors of the compare is SQL Null, the comparison will produce an SQL Null. When combined with *OR and *AND operators, an SQL Null factor will continue to produce an SQL Null. A conditional expression that produces an SQL Null will evaluate to false.
  • SQLNULL comparisons will always stay as SQLNULL if the SQLNULL value is true. That is, when an expression is testing an SQLNULL, and there IS an SQLNULL, the expression will keep the SQLNULL value. For these types of scenarios, the *ORIF boolean feature should be used.

...

Condition

Result

#A.IsSqlNull

TRUE

#A.IsNull

FALSE

(#A.IsSqlNull) *orif (#A.IsNull)

TRUE

IF_NULL(#A #B #C)

FALSE

IF_NULL(#C)

TRUE

#A.AsValue(*ZERO) *EQ *ZERO

TRUE

#A *EQ *ZERO

FALSE

#A *EQ #B

FALSE

#A *LE #B

FALSE

#B *EQ #C

FALSE

#B *LE #C

FALSE

Anchor
Expressions
Expressions
Expressions

When expressions are being evaluated, intermediate results retain the SQL Null state. They are ALWAYS strictly interpreted. For example, when #B is SQL Null,  the result of expression '#B + 1' is SQL Null. That is, SQL Null plus 1 is still SQL Null. This is independent of the attributes of any result field.

...