我在循环中执行选择查询时遇到错误。我收到了这个错误:
[Error: ORA-01000: maximum open cursors exceeded]
这是执行的查询:
Oracle_POOL.getConnection( function(err, connection) {
if (err){
console.log(".getConnection err --> ", err);
if (connection)
connection.release(
function(err) {
if (err) {
console.log(".getConnection -> connection.release -> err",err)
}
}
);
callBack(err, { rows : [] }, retBuff);
} else {
var OracleConfig={outFormat: oracle.OBJECT};
if ((/(^[ ]*Update)|(^[ ]*insert)/gi).test(selectQuery)) OracleConfig.isAutoCommit = true; //AutoCommit on update or insert
connection.execute(selectQuery, LstParam, OracleConfig , function(err, results) {
if (err) {
console.log("*err : ", err);
}
connection.release( function(err2) {
if (err2) {
console.log("connection.execute -> connection.release -> err",err)
}
callBack(err, results, retBuff);
}
);
});
}
});
如何在 nodejs 中关闭游标结果?