Write Table
Operation name
Write Table
Function overview
Writes input data to a table.
Data model
The data model of this component is table model type.
Tutorials
For details about how to create a connection to a MySQL database, refer to the following tutorial:
Properties
For details on use of variables, refer to Variables.
Basic settings
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
Name |
Required |
Not available |
Enter a name that is used on the script canvas. |
|
Input data |
Required |
Not available |
Select a component on the script canvas. |
|
Required settings
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
Destination |
Required |
Not available |
Select a connection resource.
Connection resource settings can be edited in |
|
Table name |
Required |
Available |
Select or enter a table name to be written to. |
|
Enclose table name with quotation marks |
Optional |
Not available |
Select whether or not to enclose the specified table name with quotation marks.
If the table name includes a character like a space, you need to enclose the table name with quotation marks. For details on characters that need to be enclosed with quotation marks, contact the database vendor. |
Quotation marks which is set in each database connector is as follows:
Note
|
Update rows with matching key |
Optional |
Not available |
Select whether to update rows whose value of the column specified as the key matches or to insert all.
|
|
Schema definition |
Required |
- |
The schema definition of the table specified in Table name is displayed. |
|
Schema definition/Target |
Optional |
Not available |
Select whether or not to include each column of the table specified in Table name in the target columns to write.
|
Note
One or more columns must be selected. |
Schema definition/Key |
Required |
Not available |
Select keys to be included as update conditions.
|
|
Schema definition/Column name |
Required |
Not available |
A column name in the table specified in Table name is displayed. |
|
Schema definition/Type |
Required |
Not available |
The type of Column name is displayed. |
It's displayed in "<Native type> (<Internal data type>)" format.
|
Property actions
Item name |
Description |
Remarks |
---|---|---|
Launch table browser |
Launch the table browser. For details about the operation procedure, refer to Table Browser. |
|
Update schema definition |
Update the schema definition of the table specified in Table name. |
|
Write settings
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
Insert mode |
Optional |
Not available |
Select a writing method for inserting all data.
|
Note
In the JDBC connector, the default value is One line insert. |
Update mode |
Optional |
Not available |
Select a writing method for updating data.
|
Note
|
Batch size |
Optional |
Available |
Specify the number of SQL statements to batch update. |
|
Enable query timeout |
Required |
Not available |
Select whether or not to enable the query timeout.
|
|
Query timeout (seconds) |
Required |
Available |
Set the query timeout. |
|
Comment
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
Comment |
Optional |
Not available |
You can write a short description of this connector. |
|
Schemas
Input schema
The number of columns varies depending on the Schema definition settings.
For schema structure, refer to Table model type .
Output schema
None.
Loading schema in Mapper
The schema is loaded automatically.
For details, refer to Edit Schema.
Transaction
Transaction is supported.
Parallel Stream Processing
PSP is supported.
For details on PSP, refer to Parallel Stream Processing.
Available component variables
Component variable name |
Description |
Remarks |
---|---|---|
count |
The number of written data records is stored. |
|
insert_count |
The number of inserted records of the written data is stored. |
|
update_count |
The number of updated records of the written data is stored. |
|
error_code |
When an error (SQLException) occurs, the error code corresponding to the error is stored. |
Note
Error codes are based on the specifications of each driver. |
message_category |
When an error occurs, the category of the message code corresponding to the error is stored. |
|
message_code |
When an error occurs, the code of the message code corresponding to the error is stored. |
|
message_level |
When an error occurs, the severity of the message code corresponding to the error is stored. |
|
error_type |
When an error occurs, the error type is stored. |
|
error_message |
When an error occurs, the error message is stored. |
|
error_trace |
When an error occurs, the trace information for the error is stored. |
|
Updating rows with matching key
When updating in the Write Table operation, select Update rows with matching key and select a column name for the key.
When the column that has been selected as key matches, the row will be updated, and when it doesn't, the row will be inserted. The column name selected as the key will be specified in the WHERE clause of UPDATE statement.

-
You can specify multiple keys as update conditions. Rows where all the columns selected as key match will be updated.
Behavior on insertion
When inserting, the column where Schema definition/Target is selected will be used as the columns to be inserted for INSERT statement.
-
Values to be inserted in columns that aren't included in targets depend on specifications of database, limitations of column, and the settings.
-
If no column with NOT NULL constraint is included in the targets, an runtime error will occur.
Example:
-
Schema definition
Selection for Target
Column name
Yes
COLUMN1
No
COLUMN2
No
COLUMN3
-
Column constraints/settings
COLUMN1
COLUMN2
COLUMN3
No
Default value is set (Default value: defaultValue)
Allow NULL
-
Input data
COLUMN1
data
-
INSERT statement to be executed
INSERT INTO <table name> (COLUMN1) VALUES ('data')
-
Post-processing data
COLUMN1
COLUMN2
COLUMN3
data
defaultValue
null
Behavior on updating
When updating, the column where Schema definition/Target is selected will be used as the columns to be updated for UPDATE statement.
Values of the columns that aren't included in targets are maintained as such without any update.
Example:
-
Schema definition
Selection for Target
Selection for Key
Column name
Yes
No
COLUMN1
No
Yes
COLUMN2
No
No
COLUMN3
-
Pre-processing data
COLUMN1
COLUMN2
COLUMN3
data1
data2
data3
-
Input data
COLUMN1
COLUMN2
updateValue
data2
-
UPDATE statement to be executed
UPDATE <table name> SET COLUMN1 = 'updateValue' WHERE COLUMN2 = 'data2'
-
Post-processing data
COLUMN1
COLUMN2
COLUMN3
updateValue
data2
data3
Difference between "Update before insert" and "Insert before update"
-
When executing the operation with Update before insert specified in Update mode, an UPDATE statement is executed for every single row and an INSERT statement will be executed if not updated.
Therefore, when there are many records to update in the input data, execution with Update before insert is more effective than execution with Insert before update.
-
When executing the operation with Insert before update specified in Update mode, an INSERT statement is executed for every single row, and if the insertion failed, an UPDATE statement is executed.
Therefore, when there are many records to insert in the input data, execution with Insert before update is more effective than execution with Update before insert.
= Remarks =When nothing is updated with the UPDATE statement, the processing succeeds. For instance, the case that an INSERT statement failed due to a cause other than key duplication applies.
Message codes, exception messages, and limitations