Execute Query
Executes SELECT SQL statements on an Oracle database and returns the results.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Connection Id - The ID of the database connection to use.
- Transaction Id - The ID of the transaction to use (optional).
- SQL Query - The SQL SELECT statement to execute, with optional template variables.
Output
- Result - The query results returned as a table structure.
How It Works
The Execute Query node retrieves data from an Oracle database by:
- Validating the provided Connection Id
- Looking up the connection and transaction in the shared dictionaries
- Using a template engine to render the SQL query with context data
- Creating an OracleCommand with the rendered SQL
- Executing the command using ExecuteReader() to get the results
- Loading the results into a DataTable
- Converting the DataTable to a Table object
- Outputting the Table object as the result
Requirements
- An active database connection established with the Connect node
- Valid SQL SELECT statement
- Appropriate permissions to execute the SQL statement and access the data
- Valid connection and transaction IDs when provided
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Connection Id
- Connection ID not found in the connections dictionary
- Transaction ID not found in the transactions dictionary (when provided)
- SQL syntax errors
- Database access errors
Usage Notes
- The SQL Query can include template variables using double curly braces (e.g.,
{{variable}}
) - Template variables are populated from the message context
- The result is returned as a table structure that can be used in subsequent nodes
- For non-SELECT statements (UPDATE, DELETE, INSERT), use the Execute Non Query node instead
- When using a Transaction Id, the query will be part of that transaction
- Large result sets may impact performance; consider using LIMIT clauses when appropriate