Component family |
Databases/Oracle |
|
Function |
tOracleInput reads a database and |
|
Purpose |
tOracleInput executes a DB query |
|
Basic settings |
Property type |
Either Built-in or Since version 5.6, both the Built-In mode and the Repository mode are |
|
|
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 |
|
|
Use an existing connection |
Select this check box and in the Component List click the NoteWhen a Job contains the parent Job and the child Job, if you need to share an existing
For an example about how to share a database connection across Job levels, see |
|
Connection type |
Drop-down list of available drivers:
Oracle OCI: Select this connection
Oracle Custom: Select this
Oracle Service Name: Select this
WALLET: Select this connection type
Oracle SID: Select this connection |
|
DB Version |
Select the Oracle version in use. |
|
Host |
Database server IP address. |
|
Port |
Listening port number of DB server. |
|
Database |
Name of the database. |
|
Oracle schema |
Oracle schema name. |
|
Username and |
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 to Since version 5.6, both the Built-In mode and the Repository mode are Click Edit schema to make changes to the schema. If the
This component offers the advantage of the dynamic schema feature. This allows you to This dynamic schema feature is designed for the purpose of retrieving unknown columns |
|
|
Built-In: You create and store the schema locally for this |
|
|
Repository: You have already created the schema and |
|
Table name |
Database table name. |
|
Query type and |
Enter your DB query paying particularly attention to properly Warning
If using the dynamic schema feature, |
Specify a data source alias |
Select this check box and specify the alias of a data source created on the Talend Runtime side to use the shared connection pool defined in the data source configuration. WarningIf you use the component’s own DB configuration, your data source connection will be This check box is not available when the Use an existing |
|
Advanced settings |
tStatCatcher Statistics |
Select this check box to collect log data at the component |
|
Use cursor |
When selected, helps to decide the row set to work with at a time |
|
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 |
|
No null values |
Check this box to improve the performance if there are no null |
Dynamic settings |
Click the [+] button to add a row in the table and fill The Dynamic settings table is available only when the For more information on Dynamic settings and context |
|
Global Variables |
NB_LINE: the number of rows processed. This is an After
QUERY: the SQL query statement being processed. This is a 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 |
This component covers all possible SQL queries for Oracle |
|
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 |
Due to license incompatibility, one or more JARs required to use this component are not |
In this scenario, we will read a table from an Oracle database using a context parameter to
refer to the table name.
-
Create a new Job and add the following components by typing their names in the design
workspace or dropping them from the Palette: a tOracleInput
component and a tLogRow component. -
Connect tOracleInput to tLogRow using a Row > Main
link.
-
Double-click tOracleInput to open its
Basic Settings view in the Component tab. -
Select a connection type from the Connection
Type drop-down list. In this example, it is Oracle SID.Select the version of the Oracle database to be used from the DB Version drop-down list. In this example, it is
Oracle 12-7.In the Host field, enter the Oracle
database server’s IP address. In this example, it is 192.168.31.32.In the Database field, enter the database
name. In this example, it is TALEND.In the Oracle schema field, enter the
Oracle schema name. In this example, it is TALEND.In the Username and Password fields, enter the authentication details.
-
Click the […] button next to Edit schema to open the schema editor.
-
Click the [+] button to add four
columns: ID and AGE 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. -
Put the cursor in the Table Name field
and press F5 for context parameter setting.
The dialog box [New Context Parameter] pops
up.For more information about context settings, see Talend Studio User Guide.
-
In the Name field, enter the context
parameter name. In this example, it is TABLE.In the Default value field, enter the
name of the Oracle database table to be queried. In this example, it is
PERSON. -
Click Finish to validate the setting.
The context parameter context.TABLE
automatically appears in the Table Name
field. -
In the Query Type list, select Built-In. Then, click Guess
Query to get the query statement.123456"SELECT"+context.TABLE+"."ID","+context.TABLE+".NAME,"+context.TABLE+".SEX,"+context.TABLE+".AGEFROM "+context.TABLE -
Double-click tLogRow to open its
Basic settings view in the Component tab. -
In the Mode area, select Table (print values in cells of a table) for a
better display of the results.
For related scenarios, see: