我正在尝试针对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();