简体   繁体   中英

Insert Data with JavaScript (SAP HANA Express 2.0)

Im learning SAP at the moment and i have some "newbie" issues with HANA DB.

I would like to add some database (with javascript / HTML5-App) but i can't find a updated tutorial.

I use SAP Hana Express 2.0

Any ideas?

There are 2 easy ways to do this, first you can build an SAP HANA application using the WebIDE and there are extensive tutorials for that or you can use the Node based library.

You can also use a combination of the both by creating a micro-service in XSA that is called by your HTML5 application.

For just straight JavaScript/HTML5 - I have a sample shell in Github that could be a good starting point. It is Node JS based.

The main parts though are including the library

var hdb = require('hdb');

Then making the insert statement to the table and passing the connection object.

var sql = 'insert into MYTABLE values(1,'mydata');
client.exec(sql, cb);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM