NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
L-37
Considerations—LOAD
When you load between an non-SQL object and an SQL table (in either direction)
and do not provide a DDL record for the Enscribe file, LOAD converts data types as
follows: SQL does not support the Enscribe data types COMPLEX and LOGICAL,
but an Enscribe field of either one of these data types is compatible with an SQL
column of data type CHARACTER with the same length as the field.
The SQL date-time and INTERVAL data types have no directly corresponding
Enscribe types. (SQL date-time and INTERVAL types existed prior to the DDL
types of the same name but are not currently equivalent for COPY and LOAD
operations.)
When you load an Enscribe field into an SQL DATETIME column, the Enscribe
field must have the BINARY 64 data type and must contain a Julian timestamp (a
64-bit value that contains the number of microseconds between 00:00 January 1,
4713 B.C. and the date and time it represents). SQL converts the Julian timestamp
into an SQL DATETIME value and then stores the DATETIME value in the
DATETIME column.
The size of a binary field for an INTERVAL depends on the range of values
specified for the INTERVAL. The value is the value of the INTERVAL expressed as
a multiple of its least significant field.
LOAD converts null values from Enscribe to SQL representation and from SQL to
Enscribe representation if the target file or table allows null values. For Enscribe-to-
SQL null value conversion, you must also specify the USESQLNULLS option. An
error occurs if you attempt to load null values into a field or column that does not
allow null values.
If a source record does not contain data for a field or column in a corresponding
target record (either because no source field was mapped to that target field or
because a specific record was a short record), LOAD uses the default value, if any,
for the target field. An error occurs if the target field has no default value.
If a target file or table does not allow null values, a field conversion error can occur
at the time LOAD compiles the operation or at the time the actual data is loaded.
DATETIME, DATE, TIME,
or TIMESTAMP
BINARY 64
A non-SQL timestamp value is represented as a Julian
timestamp.
INTERVAL BINARY 16, 32, or 64,based on INTERVAL
precision:
If < or = 4, BINARY 16
If > or = 5 and
< or = 9, BINARY 32
If > or = 10, BINARY 64
(The COLUMNS table indicates the size in bytes.)
A non-SQL value is represented in the smallest units
specified. For example, DAYS TO SECONDS would
produce a value in number of seconds.
NULL Ignored
SQL Data Type Enscribe Data Type