2

我正在尝试针对 vertica 运行 node-odbc,并且在运行简单的准备好的语句时遇到了一个奇怪的错误。该行已插入数据库中,但程序退出时statement.execute()出现以下错误:

$ 节点 index.js
未定义:0

错误:参数无效

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();
4

0 回答 0