0
When I run this query:
SELECT xml_nfe FROM NDD_COLD.COLD_PROD WHERE ide_id ='NFe42200602831172001104550000010390091233318028'
In plsql it returns me a line with information, then I pass the same query in the nodejs this way:
const dbConfig = require("./conexaoDBoracle.js");
const oracledb = require("oracledb");
class ConsultaXML {
async consultaXML() {
let connection;
try {
connection = await oracledb.getConnection(dbConfig)
let result = connection.execute(`SELECT xml_nfe FROM NDD_COLD.COLD_PROD WHERE ide_id ='NFe42200602831172001104550000010390091233318028'`);
console.log((await result))
return (await result).rows;
} catch (err) {
console.error(err);
}
}
}
module.exports = new ConsultaXML;
and he returns it to me:
{ metaData: [ { name: 'XML_NFE' } ], rows: [] }
Does anyone have any idea what it might be?
You even tried to do this query using the
bind
proide_id
?– Cmte Cardeal
after my connection I added the following: oracledb.fetchAsString = [oracledb.CLOB] , and the return of the method like this: const clob = (await result). Rows[0][0]; Return clob Because of the size of the return query, as per the oracle’s manual: https://blogs.oracle.com/opal/nodoracledb-112:-Working-with-lobs-as-string-and-buffer-Connection-Pinging
– Felix Ezequiel