Overview
This node allows executing SQL queries and retrieving metadata from a Sybase database using the JTDS driver via a Java-based command line tool. It supports three main operations: running arbitrary SQL queries, fetching table column definitions, and listing schemas with their tables.
Common scenarios include:
- Running custom SQL queries to fetch or manipulate data.
- Retrieving detailed column information for a specific table.
- Getting an overview of available schemas and tables in the database.
Practical examples:
- Executing a SELECT query to retrieve customer records.
- Getting the structure of a "users" table to dynamically build forms.
- Listing all user-defined tables in the database schema for auditing purposes.
Properties
| Name | Meaning |
|---|---|
| Operation | The action to perform. Options: - Execute Query - Get Table Definition - Get Schema and Tables List |
| Query | The SQL query string to execute (only for "Execute Query" operation). |
| Table Name | The name of the table to get definition for (only for "Get Table Definition" operation). |
| Schema Name | The schema name of the table (only for "Get Table Definition" operation). |
Output
The output is an array of items where each item contains a json object representing a row returned by the executed query or metadata request.
- For Execute Query, the JSON objects correspond to the rows returned by the user's SQL query.
- For Get Table Definition, each JSON object 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 JSON object includes:
name: The schema/user name.name: The table name (note: both fields are namednamein the query result).
No binary data output is produced by this node.
Dependencies
- Requires a valid Sybase database connection with host, port, database name, username, and password.
- Uses a Java runtime environment to execute a Java class (
SybaseQuery) that performs the actual database interaction via the JTDS JDBC driver. - The Java classpath must include
/app/lib/jtds-1.3.1.jarand/app/lib/json.jar. - Requires credentials containing the necessary connection details and authentication for the Sybase database.
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 filled.
- Empty SQL query: When using the "Execute Query" operation, the query cannot be empty; otherwise, an error is thrown.
- Missing table or schema names: For "Get Table Definition", both table name and schema name must be provided.
- Java execution errors: Errors during the Java process execution or JSON parsing will result in an error message prefixed with "Error ejecutando consulta". Check that Java is installed and the classpath is correct.
- SQL syntax errors: If the SQL query is malformed or invalid, the underlying Java tool will fail, causing an error. Validate your SQL syntax before running.