Skip to Content
Technical Articles

First Node-RED flow node that executes commands and query on SAP HANA database using Node.JS driver

Introduction

During this hard times with the coronavirus crisis I found some spare time to learn and test Node-RED and I asked myself without luck “Why there isn’t any node published to get data from SAP HANA Express v2.0?”

As any respectable programmer I took the challenge to deliver first Node-RED contrib node for executing queries to SAP HANA in–memory database engine.

With this release I consider myself worthy of saying the I’m proficient in Node-RED starting today 😉

It is tested with my SAP HANA Express v2.0SPS04 installed on my home server, details here : https://blogs.sap.com/2019/11/06/how-to-install-an-sap-hana-express-2.0-sps04-vm-server-for-development-on-the-budget/

There is short README.md file and an example flow how to use the node. Please let me know via github about issues or via email for any other topics.

https://www.npmjs.com/package/node-red-contrib-sap-hana

 

How to Use It

This package contains one node to run a sql command, call a procedure or a select statement for SAP HANA database using the office @sap/hana-client Node.JS driver.

Query node usage:

You will need to fill in the following fields:

— Database host name and port.

— User name to access the database.

— Password for the user name above.

— Schema name.

Node usage:

The returned data will be stored in msg.payload and it will contains the @sap/hana-client response.

To run a command or a query input to saphana node the folowing message :

msg.topic = "SQL"; // or lower case 'sql' 
msg.payload = "SELECT * FROM DUMMY"; 
return msg;

As an OK response you’ll receive on the saphana node (or error):

{ topic : "RESULT_IN_LAYLOAD", payload : [{"DUMMY":"X"}] }

 

Currently, only SAP HANA Express has been tested.

Please let me know if you have any issue !

 

Example Flow Print Screen

https://github.com/radu103/node-red-contrib-sap-hana/blob/master/flows.json

/
1 Comment
You must be Logged on to comment or reply to a post.
  • Very nice, the moment i used Node Red for the first time i was also like nothing related to SAP. Well done, motivated me to also to create something:)