Sybase

Interactúa con una base de datos Sybase usando JTDS

Overview

This node interacts with a Sybase database using the JTDS driver via an external Java process. It supports three main operations:

  • Execute Query: Run any custom SQL query on the Sybase database.
  • Get Table Definition: Retrieve the column names, data types, and lengths for a specified table within a given schema.
  • Get Schema and Tables List: List all user tables along with their schemas.

Common use cases include automating database queries, extracting metadata about tables for dynamic workflows, or integrating Sybase data into other systems without manual SQL scripting.

For example, you might use the "Get Table Definition" operation to dynamically generate forms or validate data based on the structure of a Sybase table.

Properties

Name Meaning
Operation The action to perform: Execute Query, Get Table Definition, or Get Schema and Tables List.
Query (Only for Execute Query) The SQL statement to execute on the Sybase database.
Table Name (Only for Get Table Definition) The name of the table whose definition is requested.
Schema Name (Only for Get Table Definition) The schema that contains the specified table.

Output

The node outputs an array of JSON objects representing the results of the executed query or metadata request.

  • For Execute Query, the output corresponds directly to the rows returned by the custom SQL query.
  • For Get Table Definition, each item includes:
    • column_name: The name of the column.
    • data_type: The data type of the column.
    • length: The length of the column.
  • For Get Schema and Tables List, each item includes:
    • The schema name.
    • The table name.

If binary data were involved, it would be included in the binary property, but this node only returns JSON data.

Dependencies

  • Requires a valid Sybase database connection with host, port, database name, username, and password.
  • Uses an external Java program (SybaseQuery) executed via the command line with the JTDS JDBC driver and a JSON library.
  • The Java runtime environment must be available where n8n runs.
  • Credentials must be configured in n8n to provide the necessary connection details securely.

Troubleshooting

  • Incomplete or invalid credentials: The node throws an error if any required credential field (host, port, database, username, password) is missing or invalid. Ensure all fields are correctly set.
  • Empty SQL query: When using the Execute Query operation, an empty query string will cause an error. Provide a valid SQL statement.
  • Missing tableName or schemaName: For the Get Table Definition operation, both properties must be provided; otherwise, an error is thrown.
  • Java execution errors: If the external Java process fails (e.g., due to classpath issues, missing JARs, or connectivity problems), the node reports the error message from the Java process. Verify Java installation, classpath correctness, and network access to the Sybase server.
  • JSON parsing errors: The node expects the Java program to return valid JSON. Malformed output will cause parsing failures.

Links and References

Discussion