SQL/MP Installation and Management Guide

Reorganizing Tables and Maintaining Data
HP NonStop SQL/MP Installation and Management Guide523353-004
8-13
Guidelines for Copying Tables
>> LOAD $ENSC.SALES.ORDERS, $VOL1.SALES.ORDERS,
+> SORTED
+> MOVE (ORDER-NUM TO ORDERNUM,
+> ORDERED-DATE TO ORDER_DATE,
+> SALESMAN TO SALESREP,
+> CUSTOMER-PO-NUM TO CUST_PO,
+> CUSTOMER-NUMBER TO CUSTNUM,
+> ITEM-LIST(1) TO ITEM_1,
+> ITEM-LIST(2) TO ITEM_2,
+> ITEM-LIST(3) TO ITEM_3,
+> ITEM-LIST(4) TO ITEM_4,
+> ITEM-LIST(5) TO ITEM_5,
+> ITEM-LIST(6) TO ITEM_6,
+> ITEM-LIST(7) TO ITEM_7,
+> ITEM-LIST(8) TO ITEM_8,
+> ITEM-LIST(9) TO ITEM_9,
+> ITEM-LIST(10) TO ITEM_10),
+> SOURCEDICT $DATA1.EORDERS SOURCEREC ORDERREC;
Loading Data Into an Enscribe File
This example loads data into an Enscribe file from an SQL table. The LOAD command
must specify the Enscribe dictionary subvolume unless the dictionary resides on the
current default subvolume. MOVEBYORDER is the default field-matching protocol,
which requires that the fields are compatible with the columns in the physical order (the
order of the fields in the DDL record and the order of the columns in the corresponding
table description).
>> LOAD $VOL1.SALES.ORDERS, $ENSC.SALES.ORDERS,
+> SCRATCH $TEMP.SCRATCH.JUNK
+> TARGETDICT $ENSC.SALES TARGETREC ORDERREC
+> MOVEBYORDER;
Guidelines for Copying Tables
The COPY utility provides another method of loading tables and files with data. When
you copy tables, consider these guidelines:
If the target is a table, the COPY operation is effectively a set of INSERT
statements with the STABLE ACCESS option and, except for key-sequenced
tables, the APPEND option. The operation must satisfy constraints and provide a
corresponding source-column value for each column defined with NO DEFAULT.
The data types of the source and target fields or columns must be compatible.
If the target is an unstructured, relative, or entry-sequenced file, data is appended
to the end of the file.
For relative input files, the COMPACT option controls whether zero-length records
are ignored or written.
COPY automatically copies values to indexes of a target table. COPY also updates
alternate-key files of a target Enscribe file.