SQL/MX 2.x Reference Manual (H06.10+, J06.03+)

SQL/MX Utilities
HP NonStop SQL/MX Reference Manual544517-008
5-16
Examples of FASTCOPY
Examples of FASTCOPY
Consider a source table ST with indexes SI1 and SI2 and the target table TT with
index TI1. Run the following command:
FASTCOPY TABLE ST TO TT INDEXES IMPLICIT;
The command copies all the rows from the source table to the target table and
automatically maintains index TI1 as part of that copying.
When you specify the index-clause as EXPLICIT:
FASTCOPY TABLE ST TO TT INDEXES EXPLICIT;
The command copies all the rows from the source table to the target table. An
explicit FASTCOPY of source index SI1 to target index TI1 is required to complete
the fastcopy operation. Because the source index SI2 has no equivalent target
index, it does not participate in the fastcopy operation.
You can also start the explicit fastcopy operation with the FASTCOPY INDEX
command (not necessarily with the FASTCOPY TABLE command) followed by the
required number of additional FASTCOPY INDEX commands and one FASTCOPY
TABLE...INDEXES EXPLICIT command, in any order.
To copy all the rows from source index SI1 to target index TI1, run the following
command:
FASTCOPY INDEX SI1 to TI1;
The base table TT can be accessed only after completing the fastcopy operation
(copying of indexes SI1 to TI1). If you try to access the table without completing
the fastcopy operation (by copying the index explicitly), it returns the following
error:
ERROR[8580] No partitions of table could be accessed