node-red查询oracle

环境部署

  1. 在node-red中安装node-red-contrib-oracledb-mod
  2. 下载安装oracle-instantclient11.2-basic (instantclient在centos下安装
  3. 编写node-red流程
  4. [
        {
            "id": "7f6af7842123485a",
            "type": "tab",
            "label": "流程 5",
            "disabled": false,
            "info": ""
        },
        {
            "id": "4a2d5d0893025e2a",
            "type": "oracledb",
            "z": "7f6af7842123485a",
            "name": "",
            "usequery": false,
            "query": "",
            "usemappings": false,
            "mappings": "",
            "server": "5aca54d4391a7987",
            "resultaction": "multi",
            "resultlimit": 100,
            "x": 580,
            "y": 200,
            "wires": [
                [
                    "f9ce8dc04e8dc97f"
                ]
            ]
        },
        {
            "id": "f9ce8dc04e8dc97f",
            "type": "debug",
            "z": "7f6af7842123485a",
            "name": "",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "payload",
            "targetType": "msg",
            "statusVal": "",
            "statusType": "auto",
            "x": 770,
            "y": 200,
            "wires": []
        },
        {
            "id": "a66013f009adab34",
            "type": "inject",
            "z": "7f6af7842123485a",
            "name": "",
            "props": [
                {
                    "p": "payload"
                },
                {
                    "p": "topic",
                    "vt": "str"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "",
            "payloadType": "date",
            "x": 190,
            "y": 200,
            "wires": [
                [
                    "b90a8507e7422b81"
                ]
            ]
        },
        {
            "id": "b90a8507e7422b81",
            "type": "function",
            "z": "7f6af7842123485a",
            "name": "",
            "func": "var SelectOneStudent=\"select * from \\\"Access\\\"\";\nvar newMsg = {\n    \"query\": SelectOneStudent\n}\nreturn newMsg;",
            "outputs": 1,
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 370,
            "y": 200,
            "wires": [
                [
                    "4a2d5d0893025e2a"
                ]
            ]
        },
        {
            "id": "5aca54d4391a7987",
            "type": "oracle-server",
            "connectionname": ",
            "tnsname": "",
            "connectiontype": "Classic",
            "instantclientpath": "/usr/lib/oracle/11.2/client64/lib",
            "host": "",
            "port": "1521",
            "reconnect": true,
            "reconnecttimeout": "5000",
            "db": "xe"
        }
    ]