Versions Compared

Key

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

...

 ASQN (Allow SQL Nulls) attribute

Specifying Conditions and Expressions in the Technical Reference Guide.

...


If the target field does not have the ASQN attribute, the behavior varies depending on whether the *STRICT_NULL_ASSIGN function option is enabled. By default, the *NULL value for the field type will be assigned to the target field. In the example below, as #C is a numeric field, it would be set  to zero. For a definition of what the *NULL value is for each of the field types refer to CHANGE Parameters.

Code Block
#C := #B

However, if *STRICT_NULL_ASSIGN has been enabled, and the example code above is executed when #B is SQL Null, a fatal error will occur as the target field does not support being set to SQL Null. When working with *STRICT_NULL_ASSIGN, the LANSA Developer must code carefully to protect against such runtime errors. For example:

...

If you wish to change the value of SQL Null fields to something more appropriate, use Intrinsic Method .AsValue. For example, the result of expression '#B.AsValue(1) + 1' is 2 when #B is SQL Null (and 5 when #B is 4).

SQL Null Handling 
 
 
 
 
 
 
 
 
 
 
 
 
[ Image Removed |../../index.htm#lansa/l4wtgu01_0255.htm]