Execute Query Activity
The Execute Query activity enables users to perform database operations such as adding, updating, and deleting records. It facilitates direct interaction with a database by executing SQL queries against a specified connection.
| Field | Description | Requirement |
|---|---|---|
| Connection name | The name of the pre-configured database connection to use for executing the query. | Required |
| Param1 | The value to be assigned to the first parameter within the SQL query. | Optional |
| Param2 | The value to be assigned to the second parameter within the SQL query. | Optional |
| Param3 | The value to be assigned to the third parameter within the SQL query. | Optional |
| Param4 | The value to be assigned to the fourth parameter within the SQL query. | Optional |
| Param5 | The value to be assigned to the fifth parameter within the SQL query. | Optional |
| Parameters | A comma-separated list or array of multiple parameter values to be passed to the SQL query. This field is used when more than five parameters are required or for dynamic parameter lists. | Optional |
| Query sql | The SQL query string to be executed against the database. Use placeholders (e.g., :1, :2) for parameters. | Required |
| Result dataset name | A unique reference name for the dataset that will store the results of a SELECT query. | Required |
Action Types & Examples
Query Execution Result
- Format: Dataset
- Example Result:
employeesDataset
Implementation Examples
Field Setup - Connection name: robustaConnection - Param1: 2314589 - Param2: Company A - Param3: area - Param4: title - Param5: robusta - Parameters: [2314589, Company A] - Query sql: SELECT * FROM db_test.customer_infos WHERE CustomerID = ':1' AND CompanyName = ':2' ; - Result dataset name: employeesDataset
Execution Parameters - Param1: ${customerID} - Param2: ${companyName} - Param3: ${area} - Param4: ${title} - Param5: ${company} - Parameters: [${customerID}, ${companyName}]
Technical Notes
The Execute Query activity supports standard SQL DML (Data Manipulation Language) operations (INSERT, UPDATE, DELETE) and DQL (Data Query Language) for data retrieval. Parameterized queries enhance security against SQL injection and improve performance through query plan caching. The placeholder syntax for parameters within the
Query sqlfield (e.g.,:1,:2) must align with the specific database driver and connection configuration.