Skip to main content Skip to complementary content

Inserting data into a Teradata database table

In this scenario, you create a Job using tTeradataTPump to insert customer data into a Teradata database table and specify the exit code to be displayed in the event of an exception error.

Three components are used in this Job:

  • tRowGenerator: generates rows as required using random customer data taken from a list.

  • tFileOutputDelimited: outputs the customer data into a delimited file.

  • tTeradataTPump: inserts the customer data into the Teradata database table in the Tpump mode.

Dropping components

Procedure

  1. Drop the required components: tRowGenerator, tFileOutputDelimited and tTeradataTPump from the Palette onto the design workspace.
  2. Link tRowGenerator to tFileOutputDelimited using a Row > Main connection.
  3. Link tRowGenerator to tTeradataTPump using a Trigger > On SubjobOk connection.

Configuring the components

Procedure

  1. Double-click tRowGenerator to open the tRowGenerator Editor window.
    In the tRowGenerator Editor window, define the data to be generated. For this Job, the schema is composed of two columns: ID and Name.
    Enter the Number of Rows for RowGenerator to generate.
  2. Double-click tFileOutputDelimited to define its properties in the Component view.
  3. Next to File Name, browse to the output file or enter a name for the output file to be created.
  4. Between double quotation marks, enter the delimiters to be used next to Row Separator and Field Separator.
    Click Edit schema and check that the schema matches the input schema. If need be, click Sync Columns.
  5. Double-click tTeradataTPump to open its Component view.
    In the Basic settings tab of the Component view, define the tTeradataTPump parameters. I
  6. Enter the Database name, User name and Password in accordance with your database authentication information.
  7. Specify the Table into which you want to insert the customer data. In this scenario, it is called mytable.
  8. In the Script generated folder field, browse to the folder in which you want to store the script files generated.
  9. In the Load file field, browse to the file which contains the customer data.
  10. In the Error file field, browse to the file in which you want to log the error information.
  11. In the Action on data field, select Insert.

Executing the Job

Procedure

  1. Press F6 to execute the Job.
  2. The Run view console reads as follows:
  3. Double-click the tTeradataTPump component to go back to its Component view.
  4. On the Advanced settings tab, select the Return tpump error check box and type in the exit code number to indicate the point at which an error message should be displayed in the console. In this example, enter the number 4 and use the default values for the other parameters.
  5. Press F6 to run the Job.
  6. The Run view console reads as follows:
    An exception error occurs and TPump returned exit code 12 is displayed. If you need to view detailed information about the exception error, you can open the log file stored in the directory you specified in the Error file field in the Basic settings tab of the Component view.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!