Finaly I found a solution under Ubuntu, since it took a few days here is a description which at least should guide in the right direction. This guide was made by help of GPT, please excuse if soemthing is not right, after a few days this is my best I could give
Please find the data to replace like
User=SYSDBA
Pass=masterkey
ODBC DNS= 192.168.1.10
etc, you need at least a basic understanding how to install things on linux.
Prerequisites
n8n installed
Node.js and NPM installed
ODBC Driver installed
Configured ODBC data source which allready has a working connection
Steps
Configure ODBC Data Source
Edit the odbc.ini
file to define your data source. This file is typically located at /etc/odbc.ini
for system-wide DSNs or ~/.odbc.ini
for user-specific DSNs.
Example configuration in odbc.ini
:
[ODBC Data Sources]
FIREBIRD_SAMPLE=Firebird ODBC Driver
[FIREBIRD_SAMPLE]
Driver=Firebird ODBC Driver
Database=192.168.1.10:C:\DB\DATA.FDB
Port=3050
User=SYSDBA
Password=masterkey
Create Node.js Script
Create a Node.js script that uses the odbc
library to connect to the database and execute a SQL query.
Example file Name odbc_select.js
:
const odbc = require('odbc');
async function runQuery() {
const connectionString = 'DSN=FIREBIRD_SAMPLE;UID=SYSDBA;PWD=masterkey;';
try {
const connection = await odbc.connect(connectionString);
const result = await connection.query('SELECT * FROM YourTable');
console.log(JSON.stringify(result));
await connection.close();
} catch (err) {
console.error('Error executing query:', err);
}
}
runQuery();
Test Node.js Script
Ensure the script works correctly by running it directly from the command line.
node /path/to/odbc_select.js
Configure n8n Workflow
Add an “Execute Command” node to your n8n workflow and configure it to run your Node.js script.
Command:
node /path/to/odbc_select.js
Execute Workflow
Start the workflow in n8n and check the output of the “Execute Command” node to ensure the data is queried and returned as expected.
Notes
Ensure the n8n process has permission to execute the script and access the required files.
Using the absolute path to the script in the “Execute Command” node helps avoid path issues.
Check the permissions and location of the odbc.ini file to ensure your ODBC configuration is correctly loaded.
This guide provides a basic overview for setting up an ODBC connection in n8n using a generic ODBC driver. Depending on your specific environment and configuration, additional adjustments may be necessary.