INTO TABLE
The INTO TABLE option identifies a table to be loaded.
If you do not qualify the table name with the creator name, LOADPLUS uses the creator name that was established when LOADPLUS connected to Db2.
Requirements
Note the following requirements when specifying INTO TABLE:
- LOADPLUS does not support Unicode table names.
- You cannot specify a view or an alias.
- If the table uses a VALIDPROC, an EDITPROC, or both, you must include the routines in your LINKLIST, JOBLIB, or STEPLIB.
- You must specify at least one INTO TABLE option for each table that you load. All tables that you specify must reside in the same table space.
- If you want LOADPLUS to check referential constraints, you cannot specify both the parent and child tables in your INTO statements in a single load execution.
- For a DSNUTILB load, if you are loading a compressed table that contains more than 255 partitions, you must specify a separate INTO statement for each partition that you are loading.
Additional guidelines
Use the following guidelines to determine how many INTO statements to use for your job and when to use the PART option:
If you are replacing data in multiple tables in a segmented table space, specify a separate INTO statement for each table as shown in the following example:
LOAD RESUME YES
INTO TABLE tableName1 REPLACE
INTO TABLE tableName2 REPLACE- Specify a separate INTO statement for each table in a segmented table space when the following conditions exist:
- You specify LOAD RESUME YES INTO TABLE tableName REPLACE.
- The table space is in REORP status.
- You want LOADPLUS to reset REORP status.
- For optimal performance when either of the following conditions exists, specify only one INTO statement without the PART option. The resulting partitioning key determines the partition into which the record is loaded, so the PART option is not necessary.
- You specify LOAD REPLACE
- You specify LOAD RESUME YES and are loading the majority of partitions in a partitioned table space
- If you specify LOAD RESUME YES and are loading only a few partitions, specify all partitions on one INTO statement (for example, INTO PART 1:3,5). This specification eliminates unloading and loading all partitions of the partitioned index and can save considerable time.
- With the exception described in the requirements, avoid specifying a separate INTO statement with PART option for each partition.
Additional considerations
Note the following additional information:
When invoking DSNUTILB, LOADPLUS typically passes the INTO statement as is to the IBM Db2 LOAD utility, with the following exceptions:
- LOADPLUS translates the TRIM option on your field specification to the appropriate STRIP specification.
- LOADPLUS does not pass the INTO statement to the Db2 LOAD utility when you include either of the following specifications. In these cases, LOADPLUS issues message BMC50178E and terminates.
- INTO TABLE tableName REPLACE
- POS instead of POSITION on the field specification
With the exception of TRIM, the syntax that you specify on the INTO statement must be valid for both LOADPLUS and the Db2 LOAD utility.
- Unless you specify UNIQUEINTO, each input file record is evaluated for each INTO statement.
- A record might not be loaded when the following conditions exist:
- You specify multiple INTO statements that LOADPLUS evaluates for the same input file record.
That record is valid for one INTO statement but not another.
In this case, the invalid input record is not loaded.
- For Db2 subsystems that are defined as MIXED=YES, LOADPLUS supports the use of DBCS characters. You can use DBCS characters in Db2 identifiers, such as table or column names, or in constants and field names specified in your INTO TABLE option.
- For information about how to enhance LOADPLUS performance when using this option, see Performance-considerations-for-the-INTO-and-UNIQUEINTO-command-options.
PERIODOVERRIDE
The PERIODOVERRIDE option tells LOADPLUS to load values from an input file into a column that is participating in the PERIOD constraint of a temporal table and is defined with GENERATED ALWAYS. If you specify both PERIODOVERRIDE and TRANSIDOVERRIDE, you must specify PERIODOVERRIDE before TRANSIDOVERRIDE.
When invoking DSNUTILB, LOADPLUS passes this option to the IBM DB2 LOAD utility.
TRANSIDOVERRIDE
The TRANSIDOVERRIDE option tells LOADPLUS to load values from an input file into a transaction-start-ID column that is defined with GENERATED ALWAYS. If you specify both PERIODOVERRIDE and TRANSIDOVERRIDE, you must specify PERIODOVERRIDE before TRANSIDOVERRIDE.
When invoking DSNUTILB, LOADPLUS passes this option to the IBM Db2 LOAD utility.
REPLACE
The REPLACE option tells LOADPLUS to replace the data in the specified table of a segmented table space. You can use this option for multiple tables in a segmented table space by specifying a separate INTO statement for each table. To replace data in all tables of a table space, BMC recommends that you specify LOAD REPLACE, as described in REPLACE.
Restrictions
Note the following restrictions when you specify TABLE tableName REPLACE:
- LOADPLUS terminates if you are loading a system-period temporal table that is enabled for versioning.
- If you are loading LOB or XML data, this option applies only to the base table. When you specify this option, LOADPLUS loads the LOB or XML table space as if you specified LOAD REPLACE.
- This option is not valid when LOADPLUS invokes DSNUTILB. LOADPLUS issues message BMC50178E and terminates.
This option is valid only for segmented table spaces and universal table spaces. For any other type of table space, LOADPLUS terminates.
- If you specify REPLACE for one table, you must specify REPLACE for all tables that are participating in the load. In other words, in the same load job you cannot replace data in some tables and add to existing data (resume) in other tables.
- LOADPLUS does not update indexes for this type of load. If you specify INDEX UPDATE, LOADPLUS changes this option to INDEX BUILD.
- LOADPLUS does not update the Db2 real-time statistics tables in this case.
IGNOREFIELDS
(BMC.DB2.SPE2304) The IGNOREFIELDS keyword specifies whether LOADPLUS should allow fields in field specifications whose names do not match any column name of any table that is specified in an INTO statement on a single LOAD command.
Value | Description |
---|---|
NO | (Default) LOADPLUS fails if any field name that is specified in an INTO statement does not match a column name in the table that you are loading. Specifying this option prevents errors that occur when misspelled field names in the field specification cause LOADPLUS to load nulls (if the column is nullable) or default values (if the column is defined as NOT NULL WITH DEFAULT). |
YES | LOADPLUS does not diagnose any field, regardless of any type or name that does not match any column name in a table specified in an INTO statement. |
PART
The PART option specifies the partition number of a partitioned table space that you want to load. LOADPLUS loads only data within the limit key range of the specified partition. You can specify one, some, or all of the partitions either individually or by specifying a range of partitions. If you do not specify PART, LOADPLUS loads all partitions of the table space.
Specifying partition numbers
Note the following information about how to specify partition numbers with the PART option:
- You can specify integer values from 1 through 4096.
- Individual partitions in a list can be in any order (but partitions within a range must be in ascending order).
- You can specify a mixture of individual partitions and ranges of partitions.
- If you specify a partition number more than once, LOADPLUS ignores any occurrence after the first.
- If you want to create a single image copy for a subset of partitions, specify only one set of contiguous partitions, either individually or as a range.
The following example illustrates a valid PART specification:
Additional considerations
Note the following additional information about the PART option:
- The PART option is not valid for partition-by-growth table spaces.
- If you specify multiple partition numbers on one INTO TABLE block, LOADPLUS allows only one INTO TABLE block.
- LOADPLUS optimizes the processing of INTO PART statements by combining statements that are the same. For example, if you specify INTO PART 1 twice on the same LOAD command, LOADPLUS combines these statements into a single INTO statement and loads one set of rows. In contrast, Db2 loads two sets of rows into partition 1 in this example.
- If data exists in partitions that are not specified on an INTO TABLE option, specify RESUME YES to save that data. Otherwise, processing terminates.
- You cannot change partition numbers when restarting your load job.
- Loading a large number of compressed partitions might result in constrained resources. If you encounter this problem, consider specifying smaller groups of partitions in multiple load steps.
PREFORMAT | The PREFORMAT option tells LOADPLUS whether to preformat the unused pages of the data set. If you specify PREFORMAT without a value, LOADPLUS assumes PREFORMAT YES. LOADPLUS also provides PREFORMAT support at the global level. See PREFORMAT. Specifying the default You can specify the default for the PREFORMAT option in your installation options module by using the PREFORMAT installation option. LOADPLUS was shipped with a default value of NO for this option. The command option overrides the default that is in the installation options module.
| ||||||||
REPLACE | If you specify PART REPLACE, LOADPLUS deletes the existing data in the partition before it loads the data. To delete existing data in all partitions, including those that you do not specify on an INTO option, use LOAD REPLACE. If you also specify INDEX UPDATE, LOADPLUS rebuilds the data-sorting indexes and updates the participating non-data-sorting indexes and nonpartitioned data-sorting indexes. LOADPLUS converts data that is in basic row format to reordered row format, but only for the partitions that you are replacing. However, if the table contains a VALIDPROC or EDITPROC, LOADPLUS loads the data according to the existing row format on the table space. Requirements and restrictions If any of the partitions that you specify are in REORP status, you must specify all partitions that are in REORP status. In addition to restrictions on the PART option itself, LOADPLUS terminates when you specify PART REPLACE and any of the following conditions exists:
|
Related topic