Skip to Content

How to insert table data in the form of json array to the Column Table?

The scenario is, I have thousands of rows to be inserted into HANA DB.

What I have been trying is, I have created a function in XSJS and there I have parsed the data in the form of JSON.

var content = JSON.parse($.request.body.asString());

Now I pass this data to the Stored Procedure. and my Stored procedure accepts Table_Type as INPUT PARAMETER (IN).

when I do

var result = query(content);

(query : where I call the function, using ("sap.hana.xs.libs.dbutils", "procedures"))

I receive response - {"proc_param":"IT_CONTAINER"}

and when I do - var result = query(1,content)

I get-

{"argname":"IT_CONTAINER","argposition":0,"procedurename":"ADD_CONTAINERS_TEST","msg":"Table-value expected, found scalar"}

What I am doing wrong?

Is this the correct way to achieve what I am trying to do?

Please suggest if there is any other way to achieve the same.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers