cancel
Showing results for 
Search instead for 
Did you mean: 

Importing mutiple records into hana using xsjs

Former Member
0 Kudos

Hello experts,

I have an assignment, Where the data is stored in jsonapi and we are importing to HANA DB.

I have imported the data (1 row) from jsonapi into HANADB using xsjs, Referred from scn

I would like to know how to import multiple records at a time into hana using xsjs.

2) I also have One more question, what are the dfifferences between xsjs and OData.

Thanks in Advance,

vinni

Accepted Solutions (1)

Accepted Solutions (1)

SergioG_TX
Active Contributor
0 Kudos

Vinni,

welcome to sap hana and specifically to xs.

you may be able to import multiple records to HANA if you use a stored procedure and call it from your xs app. your stored procedure should have an input param of a table type. this table type may contain 1+ records so you can perform the insert in HANA db.

the difference between xsodata and xsjs..

xsodata is the odata layer for HANA. you may expose vies and tables from xsodata.. you will need to know syntax on how to expose, query, filter, aggregate data. the response can be json or xml.

xsjs- server side javascript.. its your server side layer on the xs engine that allows you to post, get, etc... as a web service.
what is your scenario

Former Member
0 Kudos

Hi Sergio,

It was very helpful.

My scenario is, we want to import the data from third party api which is in json format into HANA DB. There are multiple rows to be imported.

I would like to know the procedure for this

Could you help me out with the steps / provide any supporting documents.

Thanks in Advance,

Shravya

SergioG_TX
Active Contributor
0 Kudos

Vinni,

there may be different ways. one which I have done would be that you create a XSJS service that takes a json payload and calls a stored procedure.

check out this blog post

Former Member
0 Kudos

Hi Sergio,

Your article was very helpful. Thank you.

1) Could you also suggest some good documents for Javascript used in hana application development

2)Is that  regular script, or different in HANA?

Thanks in Advance,

Shravya

SergioG_TX
Active Contributor
0 Kudos

kindly, Please mark questions correct or helpful.

as far as JavaScript.. the xsjs code you see is server side JavaScript. as far as client side JavaScript, you can see any JavaScript code training such as open.sap.com, code academy, w3 schools, etc.   the client side JS is the same.. the server side JS is specific to HANA as it uses a server side JS library.

Answers (0)