SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
L-39
Considerations—LOAD
then the field normally contains ASCII character data. However, if the field
contains binary 0 in each of the 10 bytes, LOAD would consider the field to
have the null value.
If the Enscribe DDL description of a file contains a field defined as:
02 F1 PIC X(10) NULL "*".
the field normally contains ASCII character data, but if the field contains "*" in
each of the 10 bytes (that is, if the field contains the value "**********"), LOAD
would consider the field to have the null value. As long as "**********" is not a
value that the field could contain in normal operation of the application, then "*"
is an acceptable NULL attribute for the field.
If the DDL description of a file contains a field defined as:
02 F1 TYPE BINARY 16 NULL 1.
the field potentially can have any value from -32768 to 32767. However, if the
field contains the value 257 (the value obtained when you place the value 1 in
each of the two bytes of the field), LOAD would consider the field to have the
null value.
When loading data from a non-SQL object to an SQL table, LOAD uses this
null value convention only if the LOAD command includes the USESQLNULLS
option. If the LOAD command includes the USESQLNULLS option, and if a
field of a record of the non-SQL object contains the field's NULL attribute value
repeated in each byte of the Enscribe field, LOAD sets the corresponding
column of the row written to the SQL table to null.
If the LOAD command does not include the USESQLNULLS option, LOAD
never interprets any field of the non-SQL object to have a null value (even if
the Enscribe DDL record description includes a NULL attribute for the field).
Therefore, even if a field of the Enscribe record contains its NULL attribute
value in each byte of the field, the field's value is copied to the column
corresponding to that field. It is not converted to the SQL null value.
When loading data from an SQL table to a non-SQL object, the
USESQLNULLS option is irrelevant. If an Enscribe field description includes
the NULL attribute, LOAD always converts an SQL null value to the Enscribe
field value obtained by placing the field's NULL attribute value into each byte of
the field. If an SQL column contains a null value and the Enscribe field
corresponding to the column does not include the NULL attribute in the
description of the field, LOAD reports file-system error 1140.
This convention for defining null values for Enscribe data sometimes is difficult
to use. You can process character fields without trouble because character
fields normally contain displayable ASCII characters in each byte. Therefore,
choosing a value for the NULL attribute of the field that is not the code of a
displayable ASCII character works easily. When you put that NULL attribute
value into each byte of the field, that gives a value for the field that is not an
expected normal value for the field. Often the field is known not to ever contain