Execute Update SQL
Operation name
Execute Update SQL
Function overview
Writes data using a SQL statement.
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 |
Optional |
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.
|
|
SQL statement |
Required |
Available |
Enter the SQL statement to be issued to the database. |
Note
You can't specify a SQL statement that consists of multiple queries. |
Schema definition |
Optional |
- |
Configure the SQL parameters specified in SQL statement. |
|
Schema definition/Column name |
Required |
Not available |
Set the SQL parameter name. |
|
Schema definition/Type |
Required |
Not available |
Select the type of SQL parameter. |
|
Property actions
Item name |
Description |
Remarks |
---|---|---|
Launch table browser |
Launch the table browser. For details about the operation procedure, refer to Table Browser. |
|
SQL Wizard |
Launch the SQL Wizard. For details about the operation procedure, refer to Update SQL Wizard. |
|
Write settings
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
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 updated data records is stored. |
Note
The number of input data records is stored during batch update processing. Example: When multiple data records are updated with one input data record, then 1 is stored in count. Even when it's not updated, the number of input data records 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. |
|
SQL parameters can be used in the Execute Update SQL operation.
In database connectors, when a SQL parameter is used, batch update will be performed.
Batch update is a function to send multiple SQL statements to a database at once and make them process.
Compared to executing SQL statements one by one, the performance is improved.
Depending on the type or what kind of database is used, batch update may not be performed even if a SQL parameter is used.
For details, refer to Message codes, exception messages, and limitations for each connector.
How to use SQL parameters
A SQL parameter is described as "?{name}". You can specify any value for "name".
Values are set to SQL parameters using Mapper.
For instance, when "insert into test_table values (?{col1}, ?{col2}, ?{col3})" is described in SQL statement, three SQL parameters (col1, col2, and col3) can be assigned dynamically.
When this Execute Update SQL operation is set to the output destination of Mapper, col1, col2, and col3 will be displayed in the output schema of Mapper. You can map values to col1, col2, and col3 in Mapper to set values for them.
-
When specifying a string type value for a SQL parameter, don't enclose it with single quotes.
A SQL statement is precompiled only when a SQL parameter is used in SQL statement.
To use a precompiled SQL statement, use a SQL parameter.
Message codes, exception messages, and limitations