tSQLiteInput
Executes a DB query with a defined command which must correspond to the schema
definition. It passes on rows to the next component via a Main row link.
tSQLiteInput reads a database file
and extracts fields based on an SQL query. As it embeds the SQLite engine, no need of
connecting to any database server.
tSQLiteInput Standard properties
These properties are used to configure tSQLiteInput running in the Standard Job framework.
The Standard
tSQLiteInput 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 |
|
Click this icon to open a database connection wizard and store the For more information about setting up and storing database |
Database |
Filepath to the SQLite database file. |
Schema and Edit |
A schema is a row description. It defines the number of fields This This |
 |
Built-in: The schema is created |
 |
Repository: The schema already |
 |
Click Edit
|
Query type |
Either Built-in or Repository |
Query |
If your query is not stored in the Repository, type in your DB query paying
If using the dynamic schema feature, the SELECT |
Advanced settings
Trim all the String/Char columns |
Select this check box to remove leading and trailing whitespace |
Trim column |
Remove leading and trailing whitespace from defined |
tStat |
Select this check box to collect log data at the component |
Global Variables
Global Variables |
NB_LINE: the number of rows processed. This is an After
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 is standalone as it includes the SQLite engine. |
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 |
Filtering SQlite data
This scenario describes a rather simple job which uses a select statement based on a
filter to extract rows from a source SQLite Database and feed an output SQLite table.
-
Drop from the Palette, a tSQLiteInput and a tSQLiteOutput component from the Palette to the design workspace.
-
Connect the input to the output using a row main link.
-
On the tSQLiteInput Basic settings, type in
or browse to the SQLite Database input file.
-
The file contains hundreds of lines and includes an ip column which the select statement will based on
-
On the tSQLite Basic settings, edit the
schema for it to match the table structure.
-
In the Query field, type in your select
statement based on the ip column. -
On the tSQLiteOutput component Basic settings panel, select the Database filepath.
-
Type in the Table to be fed with the
selected data. -
Select the Action on table and Action on Data. In this use case, the action on table
is Drop and create and the action on data is
Insert. -
The schema should be synchronized with the input schema.
-
Save the job and run it.
The data queried is returned in the defined SQLite file.
For an example of how to use dynamic schemas
with Input components, see Writing dynamic columns from a database to an output file.