Component Family |
Databases/Teradata |
|
Function |
As the combination of tTeradataFastLoad, tTeradataMultiLoad, tTeradataTPump, and tTeradataFastExport, tTeradataTPTExec loads the data from an existing |
|
Purpose |
tTeradataTPTExec offers high |
|
Basic settings |
Property Type |
Either Built-In or Repository. Since version 5.6, both the Built-In mode and the Repository mode are |
|
|
Built-In: No property data stored |
|
|
Repository: Select the repository |
|
Execution platform |
Select the Operating System that will be used to run the Job, |
|
TDPID |
Specify the Teradata director program identifier. It can be either |
|
Database name |
Specify the name of the Teradata database. |
|
Username and |
Specify the username and the password for the Teradata database To enter the password, click the […] button next to the |
|
Schema and Edit |
A schema is a row description. It defines the number of fields to be processed and passed on Since version 5.6, both the Built-In mode and the Repository mode are NoteAvoid using a Teradata database keyword as a Db Column name in the schema. If you |
|
|
Built-In: You create and store the schema locally for this |
|
|
Repository: You have already created the schema and |
Click Edit schema to make changes to the schema. If the
|
||
|
Consumer Operator |
Select a consumer operator from the drop-down list.
For more information about Teradata consumer operators, see http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/Load_and_Unload_Utilities/B035_2445_071A/2445ch02.109.18.html. |
|
Action On Data |
Select an action to be performed on the data from the drop-down list.
NoteYou must specify at least one column as the primary key on This list field appears only when the Update or Stream |
|
Producer Operator |
Select a producer operator from the drop-down list. Currently, DataConnector: accesses files For more information about Teradata producer operators, see http://www.info.teradata.com/HTMLPubs/DB_TTU_13_10/index.html#page/Load_and_Unload_Utilities/B035_2445_020A/2445ch02.04.16.html. |
|
Table |
Specify the name of the table to be written into the Teradata |
|
Script generated folder |
Specify the directory under which the Teradata Parallel |
|
Load file |
Specify the file holding the data to be loaded into the Teradata |
|
Error file |
Specify the file in which log messages will be recorded. |
Advanced settings |
Field separator |
Character, string or regular expression to separate fields. |
|
Define Log table |
Select this check box to specify a log table so that log messages |
|
Set Script Parameters |
Select this check box to define script parameters, which will be |
|
Load Operator |
Specify the load operator. This field appears only when the Set Script |
|
Data Connector |
Specify the data connector. This field appears only when the Set Script |
|
Job Name |
Specify the name of a Teradata Parallel Transporter Job which is For further information about the tbuild This field appears only when the Set Script |
|
Layout Name (schema) |
Specify a schema for the data to be loaded. This field appears only when the Set Script |
|
Return mload error |
Select this check box to specify the exit code number to indicate |
|
Define character set |
Select this check box to specify the character encoding to be used |
|
Apply TPT consumer operator optional attributes |
Select this check box to define optional attribute(s) for the For more information about optional attributes of each consumer |
|
Optional attributes |
Click the [+] button below the
For more information about the attribute value definition, see This table appears only when the Apply TPT |
|
tStatCatcher Statistics |
Select this check box to collect the log data at the component |
Global Variables |
EXIT_VALUE: the process exit code. This is an After ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|
Usage |
Used as a single-component Job or Sub-Job, this component offers |
|
Log4j |
The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html. |
|
Limitation |
The Teradata client tool with the Teradata Parallel Transporter |
This section lists all supported optional attributes for each consumer
operator.
-
For the Load operator:
BufferSize, ErrorLimit, MaxSessions, MinSessions, TenacityHours,
TenacitySleep, AccountId, DataEncryption, DateForm, ErrorTable1,
ErrorTable2, LogonMech, LogonMechData, NotifyExit, NotifyExitlsDLL,
NotifyLevel, NotifyMethod, LogSQL, NotifyString, PauseAcq, PrivateLogName,
QueryBandSessInfo, WildcardInsert, WorkingDatabase, TraceLevel -
For the Inserter operator:
AccountId, DataEncryption, DateForm, LogonMech, LogonMechData, LogSQL,
PrivateLogName, QueryBandSessInfo, ReplicationOverride, TraceLevel,
WorkingDatabase -
For the Update operator:
PrivateLogName, BufferSize, ErrorLimit, MaxSessions, MinSessions,
TenacityHours, TenacitySleep, AccountId, AmpCheck, DataEncryption, DateForm,
DeleteTask, DropErrorTable, DropLogTable, DropWorkTable, ErrorTable1,
ErrorTable2, LogonMech, LogonMechData, LogSQL, NotifyExit, NotifyExitIsDLL,
NotifyLevel, NotifyMethod, NotifyString, PauseAcq, QueryBandSessInfo,
QueueErrorTable, WorkingDatabase, WorkTable, TraceLevel -
For the Stream operator:
Buffers, ErrorLimit, MaxSessions, MinSessions, Pack, Rate, Periodicity,
TenacityHours, TenacitySleep, AccountId, AppendErrorTable, ArraySupport,
DataEncryption, DateForm, DropErrorTable, DropMacro, ErrorTable, LogonMech,
LogonMechData, MacroDatabase, OperatorCommandID, NotifyExit,
NotifyExitlsDLL, NotifyLevel, NotifyMethod, LogSQL, NotifyString,
PackMaximum, PrivateLogName, QueryBandSessInfo, QueueErrorTable,
ReplicationOverrride, Robust, WorkingDatabase, TraceLevel
This scenario describes a Job that creates a new Teradata database table, writes data
into a delimited file, then loads the data from the file into this table, and finally
retrieves the data from the table and displays it on the console.
-
Create a new Job and add the following components by typing their names in
the design workspace or dropping them from the Palette: a tTeradataRow
component, a tFixedFlowInput component, a
tFileOutputDelimited component, a
TeradataTPTExec component, a tTeradataInput component, and a tLogRow component. -
Connect tFixedFlowInput to tFileOutputDelimited using a Row > Main
connection. -
Do the same to connect tTeradataInput to
tLogRow. -
Connect tTeradataRow to tFixedFlowInput using a Trigger > On Subjob Ok
connection. -
Do the same to connect tFixedFlowInput to
TeradataTPTExec and TeradataTPTExec to tTeradataInput.
Creating a new Teradata database table
-
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.12345678910CREATE 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
-
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.123451;Ford;Male2;Rose;Female3;Sabrina;Female4;Teddy;Male5;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
-
Double-click TeradataTPTExec 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.Note
For VARCHAR attributes, enter their values between double quotation
marks.
Retrieving data from the Teradata database table
-
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.1SELECT * 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.