下面是一个插入的测试语句: var doinsert1 =function (conn,cb) { conn.execute( “INSERT INTO shocker.test VALUES (:id,:fingerprint)”, [1,‘123’], function (err,result) { if (err) { return cb(err,conn); } else{ console.log (“Rows inserted:” + result.rowsAffected); return cb(null,conn); } }) ; }; 查询语句: var doquery_array = function (conn, cb) { conn.execute( “SELECT id, fingerprint FROM test WHERE id LIKE ‘1’ ORDER BY fingerprint”, function(err, result) { if (err) { return cb(err, conn); } else { console.log ("----- oracledb_test --------"); console.log (result.rows); return cb(null, conn); } }); }; 控制台显示:
SQL/PLUS中查询:
- -代码里少了commit,加了就可以了