Quantcast
Channel: SCN : All Content - SAP HANA Cloud Platform Developer Center
Viewing all articles
Browse latest Browse all 3285

HCP - XSJS calling stored procedure error

$
0
0

Hello gurus,

 

I have an xsjs service which i am calling from a UI. the Service gets called just fine.

the xsjs is making a call to a stored procedure, however, the stored procedure returns this error everytime I call it. The same code works on an on-prem system but not on the hcp (trial)

 

1281 - SQL error, server error code: 1281. wrong number or types of parameters in call: IN_TT is not bound --- I am not sure why IN_TT is not bound as I am passing the input param from the xsjs side and the sp contains this input parameter which is a table type in my model

 

my hdb procedure looks like :

PROCEDURE "schema"."pathtosp::SP_TEST" ( IN IN_TT "schema"."pathtomodel::model.ID_TT",    OUT OUT_TT "schema"."pathtomodel::model.ID_TT"
)   LANGUAGE SQLSCRIPT   SQL SECURITY INVOKER   --DEFAULT SCHEMA <default_schema_name>   --READS SQL DATA    AS
BEGIN    OUT_TT = SELECT * FROM :IN_TT;
END

 

my xsjs code looks like:

 

 function tests(request){       var output = { insertedIds: [], errors: [] };               try {    var connection = $.hdb.getConnection();    var spInsert = connection.loadProcedure(schema, spProjectPath + '::SP_TEST');    var result = spInsert(request.IN_TT);    output.insertedIds = result.OUT_TT;       connection.commit();    }    catch(ex) {    output.errors.push(ex.toString());    }        return { responseMessage: 'called insert Stored Proc', output: output };    }

and the json object i am sending to the service is:

{

IN_TT: [ { ID:1 }, {ID:2} ]

}

 

 

again, the service is reachable, the sp gives me the error when i call it from postman on the chrome browser

I do already have access  to insert into the table (defined in a role)


Viewing all articles
Browse latest Browse all 3285

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>