Purpose
The BEGIN LOADING command:
Syntax
where
Syntax Element |
Description |
dbname |
Name of the database in which each table resides. Teradata FastLoad uses the current default database if a database name is not included with the table name specifications. To refer to more than one database, include the database name with the table name specifications. |
tname1 |
Name of the Teradata FastLoad target table to receive the data from the client system. A name that duplicates the name of an existing table cannot be used unless restarting a paused Teradata FastLoad job. The name must be a new table name. |
errortname1 |
Name of the first error table. A name that duplicates the name of an existing table cannot be used unless restarting a paused Teradata FastLoad job. The name must be a new table name. |
errortname2 |
Name of the second error table. A name that duplicates the name of an existing table cannot be used unless restarting a paused Teradata FastLoad job. The name must be a new table name. |
CHECKPOINT |
Enables the checkpoint option. |
integer |
Value that specifies the number of rows transmitted to the Teradata Database between checkpoints using the CHECKPOINT keyword to enable the checkpoint option. (The checkpoint option is not enabled if it is not included the CHECKPOINT keyword in the BEGIN LOADING command.) For more information about specifying the CHECKPOINT integer value, see Table 26. |
INDICATORS |
Places null indicator bits at the front of each record. The number of fields in each record determines how many bytes contain null indicators, as described in the Indicators topic under “Usage Notes” for this command. Note: The INDICATORS specification cannot be used when loading records in variable‑length text format. If the Teradata FastLoad job script specifies INDICATORS in the BEGIN LOADING command and the VARTEXT option in the SET RECORD command, the utility terminates with an error message. Note: INDICATORS mode is not recommended when using TEXT record format. Please use UNFORMATTED record format instead. |
DATAENCRYPTION value |
Enables data encryption for a Teradata FastLoad job. The options for value are: This option will apply only to the BEGIN LOADING request and the requests after the BEGIN LOADING command. Using this option overwrites the data encryption settings specified by both the runtime parameters and in the floadcfg.dat configuration file. |
NODROP |
Retains the error table at the end of a job, even if the error table is empty. Note: When using this option, be careful to manually drop all error tables before running additional jobs that use the same tables. Failure to do so results in Teradata Database errors. (Default) If this option is not specified, the error table is dropped at the end of a job if the error table is empty. |
Usage Notes
Table 26 describes the things to consider when using the BEGIN LOADING command.
Topic |
Usage Notes |
Required Privileges |
The user ID that is logged in to the Teradata FastLoad job must have: |
Restart Log Table |
To run Teradata FastLoad, the following privileges must be available to user PUBLIC on the Teradata FastLoad restart log table (SYSADMIN.FASTLOG): |
Error Tables Descriptions |
Teradata FastLoad creates two error tables when executing the BEGIN LOADING command: |
Duplicate Records |
The Teradata Database ignores duplicate records, which are not inserted in either error table. |
Reusing Table Names |
If an error table has one or more rows, it is not dropped from the Teradata Database at the end of a Teradata FastLoad job. To reuse the names specified for the error tables, use the DROP TABLE statement to remove the tables from the Teradata Database. For more information, see “Error Recording” on page 77. |
Checkpoints |
The CHECKPOINT option defines points in a job where Teradata FastLoad pauses to record that the Teradata Database has processed a specified number of input records. When checkpoints are used, the entire Teradata FastLoad job need not be run if it stops before completion. Teradata FastLoad uses the checkpoint information in the restart log table to determine the restart location. When specifying the integer value for the CHECKPOINT option: For more information, see “Checkpoint Tradeoffs” on page 56. |
Indicators |
Indicators are bits at the beginning of a record that identify the nulled fields in the record. When INDICATORS in the BEGIN LOADING command are specified, Teradata FastLoad expects the first bytes of the record to contain an indicator bit for each record field. If the INDICATORS option is set but indicator bits are not entered at the beginning of the record, Teradata FastLoad assumes that the first field contains indicator bytes and loads the record incorrectly. Indicator bits must be stored in a minimum of eight‑bit bytes. For example, if a record contains from one to eight fields, one byte is required for the indicator bits. If a record contains from nine to 16 fields, two bytes are required for the indicator bits, and so on. Set unused bits in indicator bytes to zero. |
Indicator Bit Positions |
The positions of the indicator bits correspond to the record fields. The first bit in the byte is the indicator for the first field in the record. If an indicator bit is set to 1, the Teradata Database nulls the corresponding field when the record is loaded. If the indicator bit is set to zero, the Teradata Database loads the data specified for that field. The following figure shows a record containing indicators. See the following documents for more information about indicator bits and the INDICATORS option: |
Example
The following command example starts a Teradata FastLoad job:
BEGIN LOADING Employee ERRORFILES ErrTable1,ErrTable2 CHECKPOINT 50000;
If the command is used to start a new job, then Teradata FastLoad responds:
BEGIN LOADING COMPLETE!
When BEGIN LOADING restarts a partially completed job, then Teradata FastLoad responds:
FastLoad is continuing a paused job!
If BEGIN LOADING is used to continue a multifile job, then Teradata FastLoad responds:
FastLoad is continuing a multifile job!