BEGIN LOADING - FastLoad

Teradata FastLoad Reference

Product
FastLoad
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2411
lifecycle
previous
Product Category
Teradata Tools and Utilities

Purpose  

The BEGIN LOADING command:

  • Identifies the Teradata FastLoad table to receive data transferred from a data source on the client computer.
  • Specifies the names of the two error tables.
  • Starts a new Teradata FastLoad job or restarts a job that has been paused.
  • Locks the tables specified in the command so that users cannot access them until an END LOADING command is executed. (After the end loading phase completes, any user with the appropriate privileges can access these tables.)
  • Optionally:
  • Indicates how often checkpoints are taken.
  • Identifies the presence of null indicators.
  • 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 variablelength 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:

  • ON = The requests will be encrypted.
  • OFF = The requests will not be encrypted.
  • 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.

     

    Table 26: Usage Note for BEGIN LOADING 

    Topic

    Usage Notes

    Required Privileges

    The user ID that is logged in to the Teradata FastLoad job must have:

  • SELECT and INSERT privileges on the Teradata FastLoad table
  • CREATE TABLE privilege on the database that owns the two error tables
  • 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):

  • DELETE
  • INSERT
  • SELECT
  • UPDATE
  • Error Tables Descriptions

    Teradata FastLoad creates two error tables when executing the BEGIN LOADING command:

  • The error table specified by errortname1 contains records that were rejected because of an error other than unique primary index or duplicate row violation.
  • The error table specified by errortname2 contains records that violated the unique primary index constraint.
  • 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:

  • If zero is entered as the value, Teradata FastLoad processes the BEGIN LOADING command as if a CHECKPOINT value is not entered.
  • If a value is not entered, or if a value is entered that is not an integer, the Teradata Database returns a syntax error.
  • 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 eightbit 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:

  • Teradata Call-Level Interface Version 2 Reference for Mainframe-Attached Systems (B035‑2417)
  • Teradata Call-Level Interface Version 2 Reference for Network-Attached Systems (B0352418)
  • 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!