IBM / node-red-contrib-db2-for-i

A Node-RED node to read and write to a Db2 for i database from Node-RED on IBM i.
https://flows.nodered.org/node/node-red-contrib-db2-for-i
8 stars 7 forks source link

The DbObject is not connected #9

Closed vinceb closed 4 years ago

vinceb commented 4 years ago

Hello,

First thanks for the job you've done. I'm trying to use the node-red-contrib-db2-for-i node to retrieve some informations on the jobs and process it. The request is good, tested on ACS SQL script tool and works fine. When i'm trying to use the db2-for-i node i've this message in the playload :

Error or Warning while executing a DB statement: exec() SQLSTATE=PAERR SQLCODE=8013 The Dbconn Object is not connected

Here is my flow : [{"id":"a6df7c7c.23da8","type":"DB2 for i","z":"dd689a72.301dc8","mydb":"7651a32e.5bc9ec","name":"Aspetr","arraymode":true,"x":530,"y":400,"wires":[["1cea3547.d2804b"]]},{"id":"d0539c16.a6353","type":"inject","z":"dd689a72.301dc8","name":"","topic":"","payload":"SELECT SUBSYSTEM, SUBSYSTEM_LIBRARY_NAME, JOB_NAME, AUTHORIZATION_NAME, JOB_TYPE, ELAPSED_CPU_PERCENTAGE, CASE WHEN (FUNCTION_TYPE <> ' ') THEN FUNCTION_TYPE CONCAT '-' CONCAT FUNCTION ELSE ' ' END AS Function, JOB_STATUS FROM TABLE (QSYS2.ACTIVE_JOB_INFO()) X WHERE JOB_STATUS = 'MSGW' ORDER BY SUBSYSTEM, SUBSYSTEM_LIBRARY_NAME, JOB_NAME;","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":400,"wires":[["a6df7c7c.23da8"]]},{"id":"1cea3547.d2804b","type":"debug","z":"dd689a72.301dc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":800,"y":400,"wires":[]},{"id":"7651a32e.5bc9ec","type":"DB2 for i Config","z":"","cnnname":"Cnx1","db":"*LOCAL","keepalive":true}]

I could not get what i'm doing wrong.

bmarolleau commented 4 years ago

Hi @vinceb , First, thx for using this cool node 😎 and for your feedback... Your query is correct, and your flow as well. Looks like an error at the driver level (idbconnector) Could you refer to this (recent) issues and see if the solution proposed can solve yours? https://github.com/IBM/nodejs-idb-pconnector/issues/36 (db2sock , and .so files issue) or this one: https://github.com/IBM/nodejs-idb-connector/issues/125 (chroot and NLS missing)

Keep us posted! thx

vinceb commented 4 years ago

You lead me to the good issue, and the winner is: https://github.com/IBM/nodejs-idb-connector/issues/125 !

I'm also using à chroot jail (the name jail is not good it brings freedom). Just added the nls option to chroot_setup, launch nodered and hiha. :)

image

Thanks @bmarolleau for your time and your efficiency.