-
Double-click tFixedFlowInput to open its
Basic settings view.
-
Select Use Inline Content (delimited
file) in the Mode
area.
In the Content field, enter the data to
be transferred:
-
Double-click the [...] button next to
Edit schema to open the schema editor.
Click the [+] button to add two columns,
namely id and age, with the type of Integer.
Click Ok to close the editor.
-
Double-click tMysqlRow to open its
Basic settings view.
-
In the Host and Port fields, enter the connection details.
In the Database field, enter the database
name.
In the Username and Password fields, enter the authentication details.
In the Query field, enter the SQL query
to retrieve the id and name data from the Mysql table employee: "select id, name from employee
WHERE id=?".
The question mark, "?", represents the parameter to be set in
the Advanced settings tab.
-
Click the [...] button next to Edit schema to open the schema editor.
-
Click the [+] button to add two columns
in the right part, namely recordset and
age, with the type of Object and Integer. Note that recordset is intended to hold the query results of the Mysql
table, namely the id and name fields.
Click OK to close the editor.
-
Click the Advanced settings tab for
further setup.
-
Select the Propagate QUERY's recordset
check box and choose recordset from the
use column list to insert the query
results in that column.
Select the Use PreparedStatement check
box and define the parameter used in the query in the Set PreparedStatement Parameters table.
-
Click on the [+] button to add a line.
In the Parameter Index cell, enter the
parameter position in the SQL instruction. Enter "1" as
we are only using one parameter in this example.
In the Parameter Type cell, enter the
type of parameter. Here, the parameter is an integer. Hence, select
Int from the list.
In the Parameter Value cell, enter the
parameter value. Here, we want to retrieve the id and name from the
employee table based on the id value from the source flow. Hence, enter
row3.id.
-
Double-click tParseRecordSet to open its
Basic settings view.
From the Prev. Comp. Column list, select
the column to parse, namely recordset.
-
Click the [...] button next to Edit schema to open the schema editor.
Click the [+] button to add three columns
in the right part, namely id, name and age, with the type of Integer, String and Integer. Note that the id and name fields are
intended to hold the parsed data of recordset.
Click OK to close the editor.
In the Attribute table, in the Value fields which correspond to id and name,
enter the name of the column in the Mysql table to be retrieved, namely
"id" and "name".
-
Double-click tLogRow to open its
Basic settings view.
In the Mode area, select Table (print values in cells of a table for
better display.