Skip to Main Content

Programming Languages & Frameworks

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot read properties of undefined(reading ‘toString’), oracledb 5.5.0

user545194Mar 7 2023

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.

This post has been answered by Christopher Jones-Oracle on Mar 16 2023
Jump to Answer
Comments
Post Details
Added on Mar 7 2023
2 comments
3,659 views