oracledb 5.5.0, Node v18.12.1
I followed this example: https://node-oracledb.readthedocs.io/en/latest/user_guide/lob_data.html#lobhandling
BLOB columns in individual queries can be fetched as buffers using fetchInfo:
const result = await connection.execute(
`SELECT b FROM mylobs WHERE id = 2`,
[ ], // no binds
{ fetchInfo: {"B": {type: oracledb.BUFFER}} }
);
if (result.rows.length === 0) {
console.error("No results");
} else {
const blob = result.rows[0][0];
console.log(blob.toString()); // assuming printable characters --<-- here
}
but getting: Cannot read properties of undefined(reading ‘toString’)
Goal is to convert the buffer to an image.