我需要使用 node js 使用第三方 webservice 并将其写入 oracle table .基本上我得到了获取数据的代码.基本上需要获取该输出并插入到 Oracle clob 列中.有人可以通过示例指导我.
i need to consume third party webservice using node js and write it on oracle table . basically i got the code for getting the data. Basically need to take that output and insert into a Oracle clob columns.Can someone guide me with examples.
一些资源:
https://github.com/oracle/node-oracledb/tree/master/examples 有 LOB 示例,例如 lobinsert1.js 和 lobinsert2.js
https://github.com/oracle/node-oracledb/tree/master/examples has LOB examples, for example lobinsert1.js and lobinsert2.js
node-oracledb 手册中有大量关于在 node-oracledb 中使用 LOB 的文档,请参阅 使用 CLOB、NCLOB 和 BLOB 数据.
There is plenty of documentation on using LOBs in node-oracledb in the node-oracledb manual, see Working with CLOB, NCLOB and BLOB Data.
例如:
// Insert a CLOB
const str = fs.readFileSync(clobInFileName, 'utf8');
result = await connection.execute(
`INSERT INTO no_lobs (id, c) VALUES (:id, :c)`,
{ id: 1, c: str }
);
if (result.rowsAffected != 1)
throw new Error('CLOB was not inserted');
else
console.log('CLOB inserted from ' + clobInFileName);
在您的情况下,您将从您的网络服务而不是磁盘读取 str文件.由于我不知道该网络服务是什么,因此无法发表更多评论.
In your case you would read str from your web service instead of a disk
file. Since I don't know what that web service is, I can't comment more.
node-oracledb 的安装说明在这里.
Installation instructions for node-oracledb are here.
这篇关于使用 Web 服务并使用 Node.js 将 CLOB 插入 Oracle 数据库表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Typeorm 不返回所有数据Typeorm Does not return all data(Typeorm 不返回所有数据)
如何将“2016-07-01 01:12:22 PM"转换为“2016-07-0How to convert #39;2016-07-01 01:12:22 PM#39; to #39;2016-07-01 13:12:22#39; hour format?(如何将“2016-07-01 01:12:22 PM转换为“2016-07-01 13:1
创建包含多个页面的 Apex 表单Create an Apex form with multiple pages(创建包含多个页面的 Apex 表单)
UNPIVOT 在多列上返回多列UNPIVOT on multiple columns to return multiple columns(UNPIVOT 在多列上返回多列)
Oracle UNPIVOT 和 SYSDATE 给出奇怪的结果Oracle UNPIVOT and SYSDATE giving weird results(Oracle UNPIVOT 和 SYSDATE 给出奇怪的结果)
如何在 Oracle PLSQL 中透视表?How to pivot a table in Oracle PLSQL?(如何在 Oracle PLSQL 中透视表?)