on 03-19-2015 1:11 PM
Hi,
I have written an xsjs application to insert data in to Header table. Below is the code. I am using HANA Ondemand trial for this.
var conn = $.db.getConnection();
conn.prepareStatement("SET SCHEMA \"_SYS_BIC\"").execute();
var st = conn.prepareStatement("INSERT INTO \"p123456trial.myhanaxs.PurchaseOrder.data::PurchaseOrder.Header\" values('1','Aswani','','','','','','',1,2,3,'','','','','')");
st.setString(1,'2');
st.setString(2,'XYZ');
st.execute();
conn.commit();
When I tried to execute this I am getting authorization issue. Please help to assing the concern role. Below is the error.
InternalError: dberror(Connection.prepareStatement): 258 - insufficient privilege: Not authorized at ptime/query/checker/query_check.cc:2422 (line 3 position 0 in /p933543trial/myhanaxs/PurchaseOrder/services/insert.xsjs)
You created this table, right? Did you also create a role for access to this table? There is no standard role that will contain rights to a table which you created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivek,
I am facing similar isue ,
ERROR
==================================
Connection.prepareStatement: needs one argument.
My code :
==================
var id = $.request.parameters.get("id");
if (id === null) {
$.response.setContentType("text/plain");
$.response.addBody("id is null!");
}
var val1 = $.request.parameters.get("val1");
if (val1 === null) {
$.response.setContentType("text/plain");
$.response.addBody("val1 is null!");
}
var output = {};
output.data = [];
var connection = $.db.getConnection();
connection.prepareStatement("SET SCHEMA \"xxxxxxxxx","TEST\"").execute();
var st = connection.prepareStatement("INSERT INTO \"pyyyyyyytrial.myhanaxs.hello::hello.model.access\" values(1,10.5)");
st.setString(1,'1');
st.setString(2,'10.5');
st.execute();
connection.commit();
connection.close();
model_acces is my .hbdfile.
============================
Scenario :
I using HANA TRIal version, I have created table name TEST and trying to insert to data into that table. But I am facing above mentioned error.
File created :in project explorer - hello project, --- xsaccess, .xsapp,,xsprivileges,hello.xsjs,model_access.hbdrole
MODELER PART - schema ( DEV one) and table TEST.
Experts, Could you please help me on this.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.