Execute Select SQL
Operation name
Execute Select SQL
Function overview
Reads 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.
Connection resource settings can be edited in |
|
SQL statement |
Required |
Available |
Enter the SQL statement to be issued to the database. |
|
Input schema definition |
Optional |
- |
Configure the SQL parameters specified in SQL statement. |
|
Input schema definition/Column name |
Required |
Not available |
Set the SQL parameter name. |
|
Input schema definition/Type |
Required |
Not available |
Select the type of SQL parameter. |
|
Output schema definition |
Required |
- |
The schema definition of the SQL statement specified in SQL statement is displayed. |
|
Output schema definition/Column name |
Required |
Not available |
The column name specified in SQL statement is displayed. |
|
Output 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. |
|
SQL Wizard |
Launch the SQL Wizard. For details about the operation procedure, refer to Select SQL Wizard. |
|
Extraction test |
Execute the specified SQL statement. The number of retrieved records will be displayed as a result. |
|
Execute SQL statement and set output schema |
Get output schema information from the SQL statement specified in SQL statement and set it in Output schema definition. |
|
Read settings
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
Fetch size |
Optional |
Available |
Specify the JDBC fetch size. |
Note
The following connectors don't have this property:
|
Enable query timeout |
Required |
Not available |
Select whether or not to enable the query timeout.
|
|
Query timeout (seconds) |
Required |
Available |
Set the query timeout. |
|
Data processing method
Item name |
Required/Optional |
Use of variables |
Description |
Remarks |
---|---|---|---|---|
Data processing method |
Required |
Not available |
Select a data processing method.
|
|
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 Input schema definition settings.
For schema structure, refer to Table model type .
Output schema
The number of columns varies depending on the Output schema definition settings.
For schema structure, refer to Table model type .
Loading schema in Mapper
The schema is loaded automatically.
For details, refer to Edit Schema.
Transaction
Transaction is supported.
Mass data processing
Mass data processing 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 retrieved data records is stored. |
Note
Value isn't stored when using PSP. |
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 Select SQL operation.
To use a precompiled SQL statement, use SQL parameters. If a precompiled SQL statement is used when executing the same SQL statement for multiple times, the performance will be improved.
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 "select * from test_table where col1 = ?{col1} and col2 = ?{col2} and col3 = ?{col3}" is described in SQL statement, three SQL parameters (col1, col2, and col3) can be assigned dynamically.
When this Execute Select 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