Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
MDouglas1687874333
Contributor III
Contributor III

Best way to handle an Oracle BLOB

I have a setup with an oracle component that makes a call to a database and returns a BLOB datatype. The BLOB only contains textual information (I know a CLOB would work better but this is the way the database is structured) and I want to extract this as a byte array and pass this to a tFileOutputRaw. 

Current skeleton/prototype: 

MDouglas1687874333_1-1758287014000.png

 

Talend seems to want to treat it as an object, if the notification from the component and the DB TYPE being orange in the schema implies this? 

MDouglas1687874333_0-1758286909742.png

 

 

This goes away when I set it to an object but it being an oracle.sql.BLOB object type, I am unsure how this should be used. I would want to get the textual value from the blob but I'm not sure how to work with this object. Any advice on this would be appreciated.

NOTE: Using a byte array works perfectly fine for this, but I am curious what, if any, benefit would be gained from using an object instead? 

Labels (7)
1 Reply
gvarun_arthasolutions
Partner - Contributor III
Partner - Contributor III

Hello,

You’re right to notice that Talend treats Oracle BLOB columns as Java objects (oracle.sql.BLOB) unless you explicitly map them to a byte[]. That orange “DB TYPE” indicator in the schema is Talend’s way of saying “this doesn’t map cleanly to a primitive type, so we’ll expose it as an Object.”

  • BLOB in Oracle = Binary Large Object. It’s designed for arbitrary binary data (images, PDFs, etc.).
  • CLOB = Character Large Object. It’s designed for textual data.
  • Since your BLOB contains text, you’re essentially storing text in a binary wrapper. That’s why you need to decide how to interpret it.

Handling in Talend

Map to byte[]

  • In the schema, set the column type to byte[].
  • Talend will automatically fetch the BLOB as a byte array.
  • You can pass this directly to tFileOutputRaw (perfect for binary/text dumps).
  • If you need to interpret it as text, wrap it in new String(byteArray, "UTF-8").

Thanks