NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-119
Considerations—COPY
The following 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.)
Display format
You can use COPY to display the contents of a table or Enscribe file on a terminal
or printer. For example, the following command prints ten rows of the EMPLOYEE
table:
>> COPY PERSNL.EMPLOYEE, $SYS1.#PRINTER, ASCII COUNT 10;
The display includes the file name, the ordinal number of each row or record, the
length of each record (in decimal bytes), and the ASCII representation of each line.
Transactions, breaks, and failures
If you use COPY to write to an audited file or table, the write always takes place
within a TMF transaction. COPY starts a transaction if a user-defined transaction is
not in progress. Because copying large amounts of data results in large amounts of
TMF audit information, you might want to use ALTER TABLE to turn off the
AUDIT attribute of the target file prior to the COPY and reset it after the COPY.
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