cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert data into two tables at once using XSJS

Former Member
0 Kudos

Hello Experts,

My requirement is to insert data into two tables at once. I have a XS JS app and want to update these tables via xsjs. How can I do this ?

Is there any mechanism like sql 'transactions' also in Hana ? If yes, how can I call it via xsjs ? If not, what are the ways to populate two different tables at once.

Please advice. Any help is really appreciated.

Thanks !

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There is nothing special about inserting into two tables at once in XSJS. Just issue two separate SQL Statements.  Don't execute the COMMIT until after both commands.  That way they are all one transaction.