Node-RED Oracle Database Connector

0.7.6 · active · verified Sun Apr 19

node-red-contrib-oracledb-mod provides robust and modern Node-RED nodes for seamless interaction with Oracle Database. It offers nodes for connecting to Oracle databases, executing SQL/PLSQL queries, and handling stored procedures/functions. Key features include resilient connection pooling to manage network disconnects and database restarts, support for DML operations (SELECT, INSERT, UPDATE, DELETE), and advanced data binding via `msg.bindVars`. The package currently stands at version 0.7.6, with releases addressing critical bugs and enhancing usability. It differentiates itself through its focus on stability, comprehensive Oracle feature support, and ease of integration into Node-RED flows. This package relies on the `oracledb` Node.js driver internally.

Common errors

Warnings

Install

Quickstart

This Node-RED flow demonstrates a basic `SELECT` query using `node-red-contrib-oracledb-mod`. It configures an Oracle connection (`oracle-server`) and uses an `oracledb` node to execute a parameterized query, sending the results to a debug tab. The Oracle Instant Client path and database credentials should be configured via environment variables or directly in the configuration node.

[{"id":"d1a8c3d1.abcd","type":"tab","label":"Oracle DB Quickstart","disabled":false,"info":""},{"id":"e1f2g3h4.ijkl","type":"oracle-server","name":"My Oracle Connection","connectionType":"Classic","connectString":"localhost:1521/ORCLPDB1","user":"system","password":"$(ORACLE_PASSWORD)","instantClientPath":"/opt/oracle/instantclient_21_13","poolMin":"2","poolMax":"10","poolTimeout":"60","x":200,"y":100,"wires":[]},{"id":"a1b2c3d4.efgh","type":"inject","name":"Fetch Employees","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":200,"wires":[["m1n2o3p4.qrst"]]},{"id":"m1n2o3p4.qrst","type":"function","name":"Prepare Query","func":"msg.query = 'SELECT employee_id, first_name, last_name, email FROM employees WHERE department_id = :1';\nmsg.payload = [60]; // Example department_id\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":200,"wires":[["u5v6w7x8.yzab"]]},{"id":"u5v6w7x8.yzab","type":"oracledb","name":"Execute Query","server":"e1f2g3h4.ijkl","action":"send single query result message","bindVars":"","x":580,"y":200,"wires":[["q1r2s3t4.uvwx"]]},{"id":"q1r2s3t4.uvwx","type":"debug","name":"Results","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":200,"wires":[]}]

view raw JSON →