tSQLiteRow
Executes the defined query onto the specified database and uses the parameters
bound with the column.
A prepared statement uses the input flow to replace the placeholders with
the values for each parameters defined. This component can be very useful for updates.
tSQLiteRow Standard properties
These properties are used to configure tSQLiteRow running in the Standard Job framework.
The Standard
tSQLiteRow 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 |
Property type |
Either Built-in or Repository |
 |
Built-in: No property data stored |
 |
Repository: Select the repository |
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 |
Schema and Edit |
A schema is a row description. It defines the number of fields |
 |
Built-in: The schema is created |
 |
Repository: The schema already |
 |
Click Edit
|
Query type |
Either Built-in or Repository |
 |
Built-in: Fill in manually the |
 |
Repository: Select the relevant |
Query |
Enter your DB query paying particularly attention to properly |
Die on error |
Clear this check box to skip the row on error and complete the |
Advanced settings
Propagate QUERY’s recordset |
Select this check box to insert the result of the query into a Note:
This option allows the component to have a different schema |
Use PreparedStatement |
Select this check box if you want to query the database using a
Parameter Index: Enter the
Parameter Type: Enter the parameter
Parameter Value: Enter the Note:
This option is very useful if you need to execute the same |
Commit every |
Number of rows to be completed before committing batches of rows |
tStat |
Select this check box to collect log data at the component |
Global Variables
Global Variables |
QUERY: the query statement being processed. This is a Flow
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 |
Usage
Usage rule |
This component offers the flexibility of the DB query and covers |
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 |
Updating SQLite rows
This scenario describes a job which updates an SQLite database file based on a
prepared statement and using a delimited file.
-
Drop a tFileInputDelimited and a tSQLiteRow component from the Palette to the design workspace.
-
On the tFileInputDelimited
Basic settings panel, browse to the input file
that will be used to update rows in the database.
-
There is no Header nor Footer. The Row separator is a
carriage return and the Field separator is a
semi-colon. -
Click the […] button next to Edit schema and define the schema structure in case it is not stored in the Repository.
-
Make sure the length and type are respectively correct and large enough to
define the columns. -
Then in the tSQLiteRow
Basic settings panel, set the Database filepath to the file to be updated.
-
The schema is read-only as it is required to match the input schema.
-
Type in the query or retrieve it from the
Repository. In this use case, we updated the
type_os for the id defined in the
Input flow. The statement is as follows:"Update download set type_os=?
.
where id=?" -
Then select the Use PreparedStatement check
box to display the placeholders’ parameter table.
-
In the Input parameters table, add as many lines as necessary to cover all
placeholders. In this scenario, type_os and
id are to be defined. -
Set the Commit every field.
-
Save the job and press F6 to run it.
The download table from the SQLite database is thus updated with
new type_os code according to the delimited input file.
Related scenarios
For a related scenario, see: