Hello Experts,
I have created one procedure on HCP, having DDL statements. It works fine when I CALL it from SQL console. But getting below error while calling through xsjs:
Error while executing query: [dberror($.hdb.Connection.executeProcedure): 258 - SQL error, server error code: 258. insufficient privilege: [258] "<schema_name>"."PROC_PM_FAILURE_PREDICT_COUNT": line 73 col 1 (at pos 2633): [258] (range 3) insufficient privilege exception: insufficient privilege: search table error: [2950] user is not authorized at ptime/query/plan_executor/trex_wrapper/trex_wrapper_body/trex_query.cc:1370]
XSJS:
//Get parameters
var tx_data_query = "";
function getTxtData(){
var txlist = [];
var connection = $.hdb.getConnection();
var statement = null;
var resultSet = null;
try{
statement = connection.loadProcedure('<schema_name>','PROC_PM_FAILURE_PREDICT_COUNT');
resultSet = statement('US','Missouri','Cape Girardeau County','Cape Girardeau','Baby Care','All');
} finally {
connection.close();
}
return resultSet;
}
function doGet() {
try{
$.response.contentType = "text/plain";
$.response.setBody(JSON.stringify(getTxtData()));
}
catch(err){
$.response.contentType = "text/plain";
$.response.setBody("Error while executing query: [" + err.message + "]");
$.response.returnCode = 200;
}
}
doGet();