tAS400Input
Reads a database and extracts fields based on a query.
tAS400Input executes a DB query with a strictly defined order which
must correspond to the schema definition. Then it passes on the field list to the next
component via a Row > Main link.
tAS400Input Standard properties
These properties are used to configure tAS400Input running in the Standard Job framework.
The Standard
tAS400Input component belongs to the Databases family.
The component in this framework is available in all Talend
products.
connector. The properties related to database settings vary depending on your database
type selection. For more information about dynamic database connectors, see Dynamic database components.
Basic settings
Database |
Select a type of database from the list and click |
Use an existing connection |
Select this check box and in the Component List click the relevant connection component to Note: When a Job contains the parent Job and the child Job, if you
need to share an existing connection between the two levels, for example, to share the connection created by the parent Job with the child Job, you have to:
For an example about how to share a database connection |
Property type |
Either Built-in or Repository |
 |
Built-in: No property data stored |
 |
Repository: Select the repository |
|
Click this icon to open a database connection wizard and store the For more information about setting up and storing database connection |
DB Version |
Select the AS 400 version in use |
Host |
Database server IP address |
Port |
Listening port number of DB server. |
Database |
Name of the database |
Username and Password |
DB user authentication data. 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 This This |
 |
Built-in: The schema is created and |
 |
Repository: The schema already exists |
 |
Click Edit
|
Query type and Query |
Enter your DB query paying particularly attention to properly
If using the dynamic schema |
Advanced settings
Additional JDBC parameters |
Specify additional connection properties for the DB connection you are |
Trim all the String/Char columns |
Select this check box to remove leading and trailing whitespace from |
Trim column |
Remove leading and trailing whitespace from defined columns. |
tStat |
Select this check box to collect log data at the component |
Usage
Usage rule |
This component offers the flexibility of the DB query and covers all |
Dynamic settings |
Click the [+] button to add a row in the table The Dynamic settings table is For examples on using dynamic parameters, see Reading data from databases through context-based dynamic connections and Reading data from different MySQL databases using dynamically loaded connection parameters. For more information on Dynamic |
Handling data with AS/400
This scenario describes a Job that writes the user information into AS/400, and then reads
the information in AS/400 and displays it on the console.
Adding and linking the components
-
Create a new Job and add a tFixedFlowInput component, a
tAS400Output component, a tAS400Input component, and a tLogRow component by typing their names in the design workspace
or dropping them from the Palette. -
Connect tFixedFlowInput to tAS400Output using a Row >
Main connection. - Do the same to connect tAS400Input to tLogRow.
-
Connect tFixedFlowInput to tAS400Input using a Trigger
> OnSubjobOk connection.
Configuring the components
Writing the data into AS/400
-
Double-click tFixedFlowInput to open its
Basic settings view. -
Click the […] button next to Edit
schema and in the Schema
dialog box define the schema by adding three columns: id of Integer type, and name
and city of String type.Click OK to close the Schema dialog box and accept the propagation prompted by the
pop-up dialog box. -
In the Mode area, select Use Inline Content (delimited file) and enter the
following user information in the Content
field.123456789101;George;Bismarck2;Abraham;Boise3;Taylor;Nashville4;William;Jefferson City5;Alexander;Jackson6;James;Boise7;Gerald;Little Rock8;Tony;Richmond9;Thomas;Springfield10;Andre;Nashville -
Double-click tAS400Output to open its Basic settings view.
-
In the Host, Database, Username and
Password fields, enter the information
required for the connection to AS/400. -
In the Table field, specify the table into which you want
to write the data. In this example, it is doct1018. -
Select Drop table if exists and create from
the Action on table drop-down list, and select
Insert from the Action on data drop-down list.
Retrieving the data from AS/400
-
Double-click tAS400Input to open its Basic settings view.
-
In the Host, Database, Username and
Password fields, enter the information
required for the connection to AS/400. -
Click the […] button next to Edit
schema and in the Schema
dialog box define the schema by adding three columns: id of Integer type, and name
and city of String type. The data structure
is same as the structure you have defined for tFixedFlowInput. -
In the Table Name field, enter or browse to the table
into which you write the data. In this example, it is doct1018. -
In the Query field, enter the SQL query sentence to be
used to retrieve the user data from AS/400. In this example, it is SELECT * FROM doct1018. -
Double-click tLogRow to open its Basic settings view.
-
In the Mode area, select Table (print values in cells of a table) for better
readability of the result.
Saving and executing the Job
- Press Ctrl + S to save the Job.
-
Press F6 or click Run on the Run tab to run the
Job.As shown above, the user information is written into AS/400, and then the data is
retrieved from AS/400 and displayed on the console.
Related scenarios
For similar scenarios using other databases, see:
Related topic in tContextLoad, see Reading data from different MySQL databases using dynamically loaded connection parameters.