node-db-oracle
node-db-oracle copied to clipboard
Failure when inserting single quote (')
The following code causes this error. If I remove the single quote from "Bob O'Neill" (ie "Bob ONeill") it works.
var oracle = require('db-oracle');
var client = new oracle.Database({
hostname: "localhost",
user: "test",
password: "test"
});
client.connect(function(err) {
if(err) { callback(err); return; }
client.query().execute("INSERT INTO Person(name,age) VALUES(?,?)", [ 'Bob O\'Neill', 21 ], function(err, results) {
console.log(err, results);
});
});
terminate called after throwing an instance of 'oracle::occi::SQLException'
what(): ORA-01756: quoted string not properly terminated