Overview
This node executes SQL queries on an Oracle Database. It allows users to run custom SQL statements with parameterized inputs, supporting both simple and complex queries including those with IN clauses. This is useful for scenarios such as retrieving data, inserting or updating records, or running any arbitrary SQL commands against an Oracle database.
Practical examples include:
- Fetching product details where product IDs are less than a certain value.
- Updating user information based on dynamic parameters.
- Running batch queries with multiple values in an
INstatement.
Properties
| Name | Meaning |
|---|---|
| SQL Statement | The SQL query to execute. Supports parameter placeholders prefixed with : (e.g., :param_name). |
| Parameters | A collection of named parameters to bind to the SQL query. Each parameter includes: - Name: The parameter name without the leading colon. - Value: The value to bind. - Data Type: Either String or Number. - Parse for IN statement: If "Yes", treats the value as a comma-separated list to be expanded into multiple bind variables for use in an IN clause. |
Output
The node outputs an array of JSON objects representing the rows returned by the executed SQL query. Each object corresponds to a row, with keys matching the column names from the query result.
If the query does not return rows (e.g., an INSERT or UPDATE), the output will be an empty array.
No binary data output is produced by this node.
Dependencies
- Requires an Oracle Database connection configured via credentials that provide username, password, connection string, and optionally privilege level and thin mode flag.
- Uses the official OracleDB Node.js driver (
oracledbpackage). - Requires n8n environment to have these credentials properly set up.
Troubleshooting
- Connection errors: Ensure the Oracle credentials are correct and the database is reachable from the n8n instance.
- SQL syntax errors: Verify the SQL statement syntax and parameter placeholders match the provided parameters.
- Parameter binding issues: Make sure parameter names do not start with a colon (
:) and that their data types correspond to the expected types in the database. - IN statement parsing: When using the "Parse for IN statement" option, ensure the value is a comma-separated string without spaces unless intended, e.g.,
1,2,3orstr1,str2,str3. - Resource cleanup: The node attempts to close the database connection after execution; if errors occur during closing, they are logged but do not fail the node execution.
Common error message example:
"ORA-00900: invalid SQL statement"— indicates a malformed SQL query."NodeOperationError: <message>"— generic wrapper for errors thrown during execution; check the inner message for details.