Data Build Manual
Customizing SQL-LOAD Output
Customizing Data Build
099331 Tandem Computers Incorporated 6–15
2. After the BUILD (F2) step, change the NULL 0 in the DDL record definition to the
null replacement value found above.
3. Run the following to update the DDL dictionary.
DDL /IN ZZDDLIN, OUT $S.#DDLNEW/
Check spooler location #DDLNEW and correct any errors.
4. Add user exit code for each nullable column to check if the input data for that
column is null. If null, then move a value (represented by that column’s DDL
NULL value) into each byte of the associated field in the output record.
Customizing SQL-LOAD
Nulls, Variation 1
If none of the 256 DDL NULL values are valid null replacement values, the next
approach is to determine if there is any value which could serve as a null replacement.
The user exit code is the same as for the first approach; the null replacement value is
moved to a field if the input data for that column is nulls. The null replacement value
is actually loaded in the table. Then after the table is loaded, the user would issue the
following SQLCI command to replace the null replacement value with a null:
SQLCI UPDATE =table SET col1-name = NULL WHERE col1=name =null-replace-value;
In this approach, to avoid a valid value from being changed to null, do not specify
NULLS as an option for that field in the Source Record Descriptions File. Both
approaches can be used together if DDL NULL works for some but not all of the
nullable columns. The DDL NULL approach has the advantage that SQLCI sets the
null replacement value at Load time and does not require the subsequent SQLCI
UPDATE.
Customizing SQL-LOAD
Nulls, Variation 2
If all possible column values are represented in the data, you must define a new
indicator column in the NSSQL table, set this column to a predetermined flag value,
for example -1, if the column contains a null and use the following command to
resurrect the null values after the NSSQL table is loaded.
SQLCI UPDATE =table SET col1-name = NULL WHERE col1-indicator =flag-value;
Example of Loading SQL Nulls with SQL-LOAD
The Data Build samples for SQL-INSERT and SQL-LOAD will give identical results. If
you run both of these, do SQL-INSERT first and then SQL-LOAD. SQL-LOAD purges
any existing data before it loads a table; SQL-INSERT adds data to any already existing
in a table.
You can see the results by entering the following commands from a TACL prompt:
OBEY DEFINES
SQLCI SELECT * FROM =DEMO02;