How to convert BLOB to String or table of content

One Star

How to convert BLOB to String or table of content

hi
Can somebody provide the procedure to convert BLOB which is java object stored in MYSQL database to String or table of content
Thanks & Regards
Bharath

Accepted Solutions
Community Manager

Re: How to convert BLOB to String or table of content

Hi 
Using a tMysqlInput to read the data from mysql table, select 'byte[]' from the Type list and select 'Blob' from the DB type on the schema of tMysqlInput, and then convert byte[] to string on a tMap, eg:
tMysqlInput--main--tMap--out1--tLogRow
on tMap, set the expression of column in the output table:
new String(row1.blobColumnName)
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: How to convert BLOB to String or table of content

Hi 
Using a tMysqlInput to read the data from mysql table, select 'byte[]' from the Type list and select 'Blob' from the DB type on the schema of tMysqlInput, and then convert byte[] to string on a tMap, eg:
tMysqlInput--main--tMap--out1--tLogRow
on tMap, set the expression of column in the output table:
new String(row1.blobColumnName)
----------------------------------------------------------
Talend | Data Agility for Modern Business