Insert Query node js:
router.post('/recent_activities', function(req, res, next) {var body =req.body;
console.log(body);
console.log( body.id + body.setid);
var query ="Insert into recent_activities (id,setid,companyid,activity_name,activity_date,activity_by,activity_group) values (? , ?, ?, ?, dateof(now()), ?)"
client.execute(query,[body.id,body.setid,body.companyid,body.activity_name,body.activity_by,'fsdf'], function(err, result) {
if (err) {
throw err;
} else {
console.log('success!');
}
});
res.json({ id:201, message: 'All Success' }); });
Error Message:
events.js:72 throw er; // Unhandled 'error' event ^ Error: Unmatched column names/values at ResponseError.DriverError (/apps/node_cassandra/node_modules/cassandra-driver/lib/errors.js:14:19) at new ResponseError (/apps/node_cassandra/node_modules/cassandra-driver/lib/errors.js:51:24) at FrameReader.readError (/apps/node_cassandra/node_modules/cassandra-driver/lib/readers.js:317:13) at Parser.parseBody (/apps/node_cassandra/node_modules/cassandra-driver/lib/streams.js:194:66) at Parser._transform (/apps/node_cassandra/node_modules/cassandra-driver/lib/streams.js:137:10) at Parser.Transform._read (_stream_transform.js:179:10) at Parser.Transform._write (_stream_transform.js:167:12) at doWrite (_stream_writable.js:226:10) at writeOrBuffer (_stream_writable.js:216:5) at Parser.Writable.write (_stream_writable.js:183:11)
via user3214361
No comments:
Post a Comment