Hello!
I am trying to run a simple insert n1ql statement but I am getting errors. I would appreciate if someone could help me out. I removed the code where the connection is created. If I run the insert statement from the web interface removing ‘’ character , it works. INSERT INTO tires-3dm
( KEY, VALUE ) VALUES (“tire_004”, {})
std::string sqlstmt = "INSERT INTO `tires-3dm` ( KEY, VALUE ) VALUES (\"tire_004\", {})";
// Initialize the queries:
lcb_CMDN1QL cmd = { 0 };
// Allocate the parameter object
lcb_N1QLPARAMS *nparams = lcb_n1p_new();
//rc = lcb_n1p_setstmtz(nparams, "select * from `tires-3dm` where plant=$param");
rc = lcb_n1p_setstmtz(nparams, sqlstmt.c_str());
if (rc != LCB_SUCCESS)
return;
lcb_n1p_mkcmd(nparams, &cmd);
rc = lcb_n1ql_query(instance, NULL, &cmd);
if (rc != LCB_SUCCESS) <=== getting error here
return;