Handling of NULLs

Visual LANSA

Handling of NULLs

When a row is fetched from the database, LANSA replaces NULL values with 0 (zero) or blanks, depending on the field type. If the row is then updated, LANSA will overwrite the NULL in the database with the zero or blank value (unless you have changed it). The only exception to this is that if a timestamp field is blank, it will be set to 1900-01-01 (the default value for timestamp fields) as blank is not valid.

Do not use a column containing a NULL value in a where condition or as part of a key. LANSA will search for values matching zero or blanks and will not find values that are NULL. In fact, if the field is a timestamp, a fatal error will occur as blank is not accepted by ODBC/SQL as a comparison value for a timestamp.

Do not use a column that contains a NULL value as a key to update a row. If you do, LANSA sets it to zero or blanks and does not retain the NULL value. As a result, a match will not be found when the update is attempted and LANSA will not perform the update.

Ý RDML PC Other File