SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
L-36
Considerations—LOAD
Field formats
If a non-SQL object is the source or target, LOAD loads only those fields whose
DDL descriptions conform these rules:
The field must be elementary, unless it is the special DDL group that
represents a variable-length character string, in which case the field is handled
as one field during the LOAD operation. This DDL group has this structure and
is converted to a column with data type VARCHAR:
02 A-VARCHAR
03 LEN PIC S9(4) COMP.
03 VAL PIC X(len).
The subfields must be named LEN and VAL, and their pictures must be exactly
as shown.
The field must not be a filler field.
LOAD ignores Level-88 CONDITION-NAME clauses and Level-66 RENAMES
clauses.
Unless you specify a REDEFINE clause in the REDEFINE option of the LOAD
command, LOAD ignores the clause and uses the original field description.
Data type compatibility and field conversions
If you are loading data from one SQL table to another SQL table, or between an
SQL table and an Enscribe file, in either direction, the data type (including the
character set) of each source field or column must be compatible with the data type
of the corresponding target field or column.
Character fields are compatible if the associated character sets are compatible (as
described previously in this entry) and if the target field or column is large enough
to hold the values loaded from the source field. If you specify TRUNCATION ON,
the latter part of this requirement is always met.
If you do not specify TRUNCATION ON and a source field has a fixed-length
character data type, LOAD can determine whether the source field is compatible
with the target field before loading actual data. However, if a source field has a
variable-length character data type, compatibility between the source and target
field depends on the actual length of the specific records or rows in the source
data. In this case, LOAD returns an error if it encounters an incompatible record
during the actual loading.
Except for the Enscribe types COMPLEX and LOGICAL, any numeric field is
compatible with any other numeric field as long as the target field is large enough
to hold the values from the source field.
The column size for the INTERVAL data type can be found in the COLUMNS table
using a command:
SELECT colname, colsize from COLUMNS WHERE TABLENAME LIKE
"%.table%";