SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
C-123
Considerations—COPY
From one table to another—each source row is inserted as a row in the target
table.
You might want to use COPY instead of LOAD for these reasons:
You can copy data within a user-defined TMF transaction.
You can copy data to an unstructured file or a nondisk file.
You can append or insert data without erasing existing data.
These rules govern the transfer of data across character sets. A COPY that
violates these rules terminates with an error.
For example, if the source field character set is UNKNOWN, you can copy it to a
target field associated with any character set. If the source field character set is
one of the nine supported ISO character sets, you can copy it only to a target field
associated with that same character set.
In addition, if you copy double-byte data into a single-byte field or copy single-byte
data into a double-byte field, the target field must be the same length, in bytes, as
the source field.
(Enscribe-to-Enscribe copies do no field-by-field conversion, so that case is not
shown in the previous table.)
You can use COPY to display the contents of a table or Enscribe file on a terminal
or printer. For example, this command prints ten rows of the EMPLOYEE table:
>> COPY PERSNL.EMPLOYEE, $SYS1.#PRINTER, ASCII COUNT 10;
Source and Target
File Types
Source Field
Character Set
Target Field
Character Set
SQL to SQL UNKNOWN Any character
set
ISO88591 ISO88591
ISO88599 ISO88599
KANJI KANJI
KSC5601 KSC5601
SQL to Enscribe UNKNOWN PIC X or PIC N
ISO88591 PIC X
ISO88599 PIC X
KANJI PIC N
KSC5601 PIC N
Enscribe to SQL PIC X Any character
set
PIC N Any character
set