Vertica icon

Vertica

Execute SQL queries against Vertica database

Overview

This node allows users to execute custom SQL queries against a Vertica database. It is useful for retrieving, updating, or manipulating data stored in Vertica by running any valid SQL statement. Common scenarios include fetching data for reporting, inserting or updating records, and performing batch operations directly from an n8n workflow.

For example, you could use this node to:

  • Retrieve the top 10 rows from a table.
  • Run complex joins or aggregations to prepare data for further processing.
  • Execute insert or update statements as part of an automated data pipeline.

Properties

Name Meaning
Query The SQL query to execute against the Vertica database. Supports multiline input.

Output

The node outputs an array of items where each item contains a json field representing a row returned by the query. If the query returns rows, each row is output as a separate item with its columns as key-value pairs inside json.

If the query does not return rows (e.g., an UPDATE or INSERT), the output contains a single item with a json object indicating success and the number of affected rows, e.g.:

{
  "success": true,
  "affectedRows": 5
}

In case of errors, if the node is configured to continue on failure, it outputs an item with an error message inside json.

Dependencies

  • Requires a Vertica database connection with credentials including host, port, database name, username, and password.
  • Uses the vertica-nodejs client library to connect and run queries.
  • Requires appropriate API authentication credentials configured in n8n to access the Vertica database.

Troubleshooting

  • Connection issues: Ensure the database credentials are correct and the Vertica server is reachable from the n8n instance.
  • SQL syntax errors: Invalid SQL queries will cause errors. Verify the query syntax directly in a Vertica client before using it here.
  • Empty results: Queries that do not return rows will output a success message with affected rows count; verify your query logic if unexpected.
  • Splitting queries: Multiple queries can be executed by separating them with --split--. Errors in any individual query will stop execution unless "continue on fail" is enabled.
  • Error messages: Typical error messages include connection failures, authentication errors, or SQL errors. Review the error text for details and adjust credentials or query accordingly.

Links and References

Discussion