node-red-contrib-db2-for-i basic flow

Description

A basic flow for reading or writing to a DB2 for i db using Node.js v6 / Node-RED on IBM i

1) SQL Query injected in msg.payload

2) The msg.database payload for injecting the db name (ex: *LOCAL). The  associated Template node name is used as a connection name for connection reuse within a Node-RED flow.

3) enter your credentials in the DB2 for i config node associated with the DB2 for i node.

4) Result in msg.payload. Not return code for now...
[{"id":"f336e0ee.99fdf8","type":"inject","z":"e5e26fd6.5797","name":"SQL Query","topic":"database","payload":"SELECT * FROM ACMEDB.MYTABLE","payloadType":"str","repeat":"","crontab":"","once":false,"x":144,"y":470,"wires":[["8c1463e2.299be8"]]},{"id":"994e12fc.b6d598","type":"debug","z":"e5e26fd6.5797","name":"","active":true,"console":"false","complete":"false","x":846,"y":472,"wires":[]},{"id":"8c1463e2.299be8","type":"template","z":"e5e26fd6.5797","name":"ACMEDB-Connection","field":"database","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"*LOCAL","output":"str","x":390,"y":472,"wires":[["6800df26.7aed4"]]},{"id":"6800df26.7aed4","type":"DB2 for i","z":"e5e26fd6.5797","mydb":"4d3a95ef.d7e97c","name":"","x":603,"y":470,"wires":[["994e12fc.b6d598"]]},{"id":"4d3a95ef.d7e97c","type":"DB2 for i Config","z":"","db":"*LOCAL"}]
bmarolleau

Flow Info

created 3 weeks ago

Node Types

Core
  • debug (x1)
  • inject (x1)
  • template (x1)
Other

Tags

  • ibmi
  • iseries
  • db2
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option