tOracleBulkExec
Offers gains in performance during operations performed on data of an Oracle
database.
tOracleBulkExec inserts, appends,
replaces or truncate data in an Oracle database.
The tOracleOutputBulk and tOracleBulkExec components are used together in a two
step process. In the first step, an output file is generated. In the second step, this
file is used in the INSERT operation used to feed a database. These two steps are fused
together in the tOracleOutputBulkExec component,
detailed in a separate section. The advantage of using two separate steps is that the
data can be transformed before it is loaded in the database.
tOracleBulkExec Standard properties
These properties are used to configure tOracleBulkExec running in the Standard Job framework.
The Standard
tOracleBulkExec 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 |
Connection type |
Drop-down list of available drivers:
Oracle OCI: Select this connection
Oracle Service Name: Select this
Oracle SID: Select this connection
Oracle Custom: Select this |
DB Version |
Select the Oracle version in use. |
Host |
IP address of the database server. |
Port |
Port number listening the database server. |
Database |
Database name. |
Schema |
Schema name. |
Username and |
DB user authentication data. To enter the password, click the […] button next to the |
Table |
Name of the table to be written. Note that only one table can be |
Action on table |
On the table defined, you can perform one of the following
None: No operation is carried
Drop and create table: The table is
Create table: The table does not
Create table if not exists: The
Drop table if exists and create:
Clear table: The table content is
Truncate table: The table content |
Data file name |
Name of the file to be loaded. Warning:
This file should be located on the same machine as the |
Action on data |
On the data of the table defined, you can perform:
Insert: Insert data to an empty table.
Update: Update the existing data. You Append: Append data to the table, whether Replace: if the table already contains
Truncate: If the table already contains |
Schema and Edit |
A schema is a row description, it defines the number of fields to Click Edit
|
 |
Built-In: You create and store the schema locally for this component |
 |
Repository: You have already created the schema and stored it in the When the schema to be reused has default values that are You can find more details about how to |
Advanced settings
Advanced separator (for number) |
Select this check box to change the separator used for the |
Use existing control file |
Select this check box if you use a control file (.ctl) and specify |
Record format |
Define the record format:
Default: format parameters are set Stream: set Record terminator. Fixed: set the Record length. Variable: set the Field size of the record length. |
Specify .ctl file’s INTO TABLE clause manually |
Select this check box to manually fill in the INTO TABLE clause of the control file. |
Fields terminated by |
Character, string or regular expression to separate fields: None: no separator is used.
Whitespace: the separator used is a
EOF (used for loading LOBs from
Other terminator: Set another |
Use fields enclosure |
Select this check box if you want to use enclosing characters for
Fields enclosure (left part):
Field enclosure (right part): |
Use schema’s Date Pattern to load Date field |
Select this check box to use the date pattern of the schema in the |
Specify field condition |
Select this check box to define data loading condition. |
Preserve blanks |
Select this check box to preserve the blanks. |
Trailing null columns |
Select this check box to load null columns. |
Load options |
Click + to add data loading
Parameter: select a loading
Value: enter a value for the |
NLS Language |
In the list, select the language used for the data that are not |
Set Parameter NLS_TERRITORY |
Select this check box to modify the territory conventions used for |
Encoding |
Select the encoding from the list, or enter the encoding between double quotes |
Output |
Select the type of output for the standard output of the Oracle to console, to global variable. |
Convert columns and table names to uppercase |
Select this check box to uppercase the names of the columns and |
tStatCatcher Statistics |
Select this check box to collect log data at the component |
Global Variables
Global Variables |
NB_LINE_DATA: the number of rows read. This is an After
NB_LINE_BAD: the number of rows rejected. This is an
NB_LINE_INSERTED: the number of rows inserted. This is an
RETURN_CODE: the return code indicating the result of
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 dedicated component offers performance and flexibility of |
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 |
Limitation |
The database server/client must be installed on the same machine |
Truncating and inserting file data into an Oracle database
This scenario describes how to truncate the content of an Oracle database and
load the content of an input file. The related Job is composed of three components that
respectively creates the content, output this content into a file to be loaded into the Oracle
database after the database table has been truncated.
Building the Job
- Drop the following components: tOracleInput, tFileOutputDelimited and tOracleBulkExec from the Palette to the design workspace.
-
Connect the tOracleInput to the tFileOutputDelimited using a Row > Main link.
- Connect the tOracleInput to the tOracleBulkExec using a OnSubjobOk trigger link.
Configuring the components
-
Double-click the tOracleInput to open its
Basic settings view. -
Define the Oracle connection details. It is recommended to store the
database connection details in the Metadata
folder of the Repository tree view in order
to retrieve them easily at any time in any Job. -
Define the schema, if it is not stored in the Repository. In this example, the schema contains four
columns as follows: ID_Contract,
ID_Client, Contract_type and
Contract_Value. -
Define the tFileOutputDelimited component
parameters, including output File Name,
Row separator and Fields delimiter. -
Double-click on the tOracleBulkExec to
define the database populating properties. -
In the Property Type list, select
Repository if you stored the database
connection details under the Metadata node
of the Repository or select Built-in to define them manually. In this
scenario, use the Built-in mode. -
Set the connection parameters in the following fields: Host, Port,
Database, Schema, Username, and
Password. -
Fill in the name of the Table to be
populated and the Action on data to be
carried out. In this use case, select insert. -
In the Schema list, select Built-in, and click the […] button next to the Edit
schema field to define the structure of the data to be passed
to the next component. -
Click the Advanced settings view to
configure the advanced settings of the component. -
Select the Use an existing control file
check box if you want to use a control file (.ctl) storing the status of the
physical structure of the database. Or, fill in the following fields
manually: Record format, Specify .ctl file’s INTO TABLE clause manually,
Field terminated by, Use field enclosure, Use
schema’s Date Pattern to load Date field, Specify field condition, Preserve blanks, Trailing null
columns, Load options,
NLS Language and Set Parameter NLS_TERRITORY according to your
database. -
In the Encoding list, select the
encoding, or enter the encoding between double quotes if it does not exist
in the list. -
In the Output list, select to console to output the standard output of the
database in the console.
Executing the Job
- Press Ctrl+S to save your Job.
-
Press F6 to run the Job. The log is shown
in the console of the Run view and the
table is populated with the parameter file data.
Related topic: see Inserting data in bulk in MySQL database.