Data Build Manual

Customizing SQL-LOAD Output
Customizing Data Build
6–22 099331 Tandem Computers Incorporated
Example of Handling SQL-LOAD NULL VARCHAR DATA
Now let’s take the previous information on handling VARCHAR data and loading
nulls and put it all together.
In order to process VARCHAR data, the DDL must contain the special GROUP
containing the LEN and VAL fields.
To load nulls for a VARCHAR column, the NULL clause must be added to the
VAL field.
The null replacement value must be replicated in every position of the full width
VAL field.
SQLCI checks every position of the full VAL field of a VARCHAR column for the
null replacement value (the LEN field is ignored) before any other processing for
this field.
To demonstrate this, let’s modify the example above. Everything is the same except:
DEM1_NAME is defined as a nullable VARCHAR column.
A DDL "NULL 2" clause is added to the VAL field. The null replacement value for
this example is a binary 2 in each position; for a binary 16 (word) value this is
%001002 (hex H’0202’) or decimal 514.
Add code to USERLIB for the third and fourth records to move the null
replacement value to VAL and set the LEN field to 0 and 25.