BLOB object to Salesforce

One Star

BLOB object to Salesforce

Hi All,
We have data in BLOB datatype in our oracle Source table. We need to send this data to Salesforce String/Base64 Column. 
Can anyone let us know how this functionality can be achieved using talend?
Thanks,
Mohit
Sixteen Stars

Re: BLOB object to Salesforce

You will need to convert from oracle.sql.BLOB to a String. Retrieve the column as an Object. Cast the Object to a oracle.sql.BLOB. 
I *think* something like this will work. Please keep in mind that this is not tested and from memory of doing it a while ago....

byte[] byteArray = blobColumn.getBytes(1,blobColumn.length());
String returnVal = new String(byteArray);

You will probably have to play with that a little to get it to work. f your blobs are massive that will also need changing to
handle memory issues.