如何将nodejs变量输入到Oracle SQL查询中

时间:2019-03-22 10:28:21

标签: sql node.js

我正在尝试将nodejs变量传递给sql查询 下面是我的代码:

var b= 101;
connection = await oracledb.getConnection(  {
user          : dbConfig.user,
password      : dbConfig.password,
connectString : dbConfig.connectString
});
sql = 'SELECT * FROM mytab where id= b';
binds = {};
                        options = {
                        outFormat: oracledb.OBJECT   // query result format
                        };

                        result = await connection.execute(sql, binds, options);

0 个答案:

没有答案