on 12-23-2014 10:07 AM
Hi Experts
I'm trying to INSERT/UPSERT values into my tables using the following xsjs code
try{
var conn = $.db.getConnection();
var query ="UPSERT \"NEO_EZPCFVLMDTZUPGEXJXXXXX\".\"LinkedIN_Connections\" VALUES('x','x','x','x','x','x','x','x','x')";
$.response.setBody("Success");
$.trace.debug(query);
var pstmt=conn.prepareStatement(query);
var rs=pstmt.execute();
$.response.setBody(rs);
conn.commit();
}
but i'm getting the following error(p.s I'm using a trial system)
dberror(Connection.prepareStatement): 258 - insufficient privilege: Not authorized at ptime/query/checker/query_check.cc:2547
try this ...
var f1 = $.request.parameters.get('f1');
var f2 = $.request.parameters.get('f2');
var f3 = $.request.parameters.get('yf3');
var output = {};
output.data = [];
var query = // YOUR QUERY
'insert into "SCHEMA"."PATH::TABLE_NAME" values(?,?,?)';
var conn = $.db.getConnection();
var cstmt = conn.prepareCall(query);
cstmt.setString(1,f1);
cstmt.setString(2,f2);
cstmt.setString(3,f3);
cstmt.execute();
conn.commit();
conn.close();
$.response.contentType = 'text/json';
$.response.setBody(JSON.stringify(output));
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you able to execute the query from HANA Studio console ? Probably the user name you are using does not have the update/insert privilege on the table .
Sreehari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.