Configuring the components
Creating a new Teradata database table
Procedure
-
Double-click tTeradataRow to open its
Basic settings view.
- Fill in the Host, Database, Username, and Password fields with your Teradata database connection details.
-
In the Query field, enter the following
SQL statement to create a new table named person with three columns id, name, sex.
CREATE SET TABLE samples.person, FALLBACK, NO BEFORE JOURNAL, NO AFTER JOURNAL ( id INTEGER NOT NULL, name VARCHAR(50), sex VARCHAR(20) ) UNIQUE PRIMARY INDEX (id)
Preparing the source data
Procedure
-
Double-click tFixedFlowInput to open its
Basic settings view.
-
Click the [...] button next to Edit schema to open the schema editor.
- Click the [+] button to add three columns: id of the integer type, name and sex of the string type.
- Click OK to close the schema editor and accept the propagation prompted by the pop-up dialog box.
-
In the Mode area, select Use Inline Content (delimited file) and enter the
input data in the Content field.
1;Ford;Male 2;Rose;Female 3;Sabrina;Female 4;Teddy;Male 5;Kate;Male
-
Double-click tFileOutputDelimited to open
its Basic settings view.
- In the File Name field, specify the file into which the input data will be written. In this example, it is E:/person.csv.
Loading the source data into an empty table
Procedure
-
Double-click tTeradataTPTExec to open its Basic settings view.
- Fill in the TDPID, Database name, Username, and Password fields with your Teradata database connection details.
- In the Table field, enter the name of the table into which the source data will be loaded. In this example, it is person.
- In the Script generated folder field, browse to the directory under which the Teradata Parallel Transporter script file will be created during the Job execution. In this example, it is E:/.
- In the Load file field, browse to the file that contains the source data. In this example, it is E:/person.csv.
- In the Error file field, specify the file in which log messages will be recorded. In this example, it is E:/error.log.
-
Click the [...] button next to Edit schema to open the schema editor.
Click the [+] button to add three columns: id of the integer type, name and sex of the string type. Note that id and name in Db Column are enclosed in a pair of \" since they are Teradata database keywords.Click OK to validate these changes and close the schema editor.
-
Click Advanced settings to open its view,
and then select the Apply TPT consumer operator
optional attributes check box and click the [+] button below the Optional attributes table to add the following attributes
needed: ErrorLimit, ErrorTable1, QueryBandSessInfo, and TraceLevel.
Information noteNote:
For VARCHAR attributes, enter their values between double quotation marks.
Retrieving data from the Teradata database table
Procedure
-
Double-click tTeradataInput to open its
Basic settings view.
- In the Table Name field, enter the name of the table to read data from. In this example, it is person.
-
In the Query field, enter the following
SQL statement to retrieve data from the table person.
SELECT * FROM samples.person ORDER BY id
-
Click the [...] button next to Edit schema to open the schema editor.
- Click the [+] button to add three columns: id of the integer type, name and sex of the string type. Note that id and name in Db Column are enclosed in a pair of \" since they are Teradata database keywords.
- Click OK to close the schema editor and accept the propagation prompted by the pop-up dialog box.
-
Double-click tLogRow to open its
Basic settings view.
- In the Mode area, select the Table (print values in cells of a table) option for a better display of the result.
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!