Error with prepared statement in node-odbc

294 Views Asked by At

I'm trying to run node-odbc against vertica and I'm getting a strange error when running a simple prepared statement. The row is inserted in the db, but the program exits at statement.execute() with this error:

$ node index.js
undefined:0

Error: Invalid argument

const odbc = require('odbc');

async function executeExample() {
  const connection = await odbc.connect('Driver=/Library/Vertica/ODBC/lib/libverticaodbc.dylib;Servername=localhost;Port=5433;Database=testdb;UserName=dbadmin;Password=')
  const statement = await connection.createStatement();
  await statement.prepare('INSERT INTO testtable (name) VALUES(?)');
  await statement.bind(['joe']);
  const result = await statement.execute();
  console.log(result);
  await statement.close();
  await connection.close();
}

executeExample();
0

There are 0 best solutions below