itemsNullable

The build descriptor option itemsNullable specifies the circumstance in which your code can set primitive fields to NULL.

Valid values are as follows:
NO (the default)
You cannot set primitive fields to NULL except in this case--
  • The field is a primitive field in a non-fixed record or is a structure field in an SQL record; and
  • The field-level property isNullable is set to yes.

This behavior is consistent with VisualAge® Generator and with previous versions of EGL.

YES
You can set any of the following fields to NULL:
  • A primitive variable, either standalone or in a non-fixed record
  • A structure field in an SQL record

The behavior is consistent with the Informix® product I4GL, but is not available for service parts or for interface parts of type basicInterface.

If a program invokes a function that is in an EGL library, both the program and library must be generated with the same setting for itemsNullable; otherwise, an error occurs when you compile the program.

The next table shows other effects of your decision.

Table 1. Effect of itemsNullable
Operation ItemsNullable is set to NO ItemsNullable is set to YES
Set a null field Not possible for fields outside of an SQL record You can set NULL by assigning an empty string ("") to a field
Test a null field Not possible for fields outside of an SQL record You can test NULL by testing the result of passing the string to the function StrLib.clip:
  myString String = "";

  // indicates that 
  // the variable is NULL
  if (StrLib.clip(myString) 
    is NULL)
    ;
  end
Assign a null field to another field The value of the source is 0 or blank, and the assignment copies both a value and (if the target is nullable) the NULL state If the target is nullable, the target is set to NULL. Otherwise, the target is set to 0 or blank
Concatenate a limited-length string with another string The limited-length string is not padded The limited-length string is padded with blanks to extend the string to the last position specified in the string declaration
Use a null field in a numeric expression The field is treated as if it contained a 0 The expression evaluates to NULL
Use a null field in a text expression The field is treated as if it contained a space The field is treated as if it were an empty string
Use a null field in a logical expression The expression is treated as if the value of the field were 0 or blank, with the next example evaluating to TRUE:
  0 == null
The expression evaluates to TRUE only if null is compared with null, as is not the case in the next example, which evaluates to FALSE:
  0 == null
SET™ field empty Null state is not set Null state is set
SET record empty Null state is not set Null state is set

Related reference
Build descriptor options

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.