
Specialist III
2014-02-26
03:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Extract JSON from MySQL blob field
Hello,
I'm trying to create a job that will extract JSON from a blob field in MySQL, then create columns in another database from the JSON data. I cant figure out how to get the JSON out of the object that is returned from the database. Is there a component I can use to parse the JSON out of the row returned from the DB?
Thanks.
I'm trying to create a job that will extract JSON from a blob field in MySQL, then create columns in another database from the JSON data. I cant figure out how to get the JSON out of the object that is returned from the database. Is there a component I can use to parse the JSON out of the row returned from the DB?
Thanks.
605 Views
5 Replies

Anonymous
Not applicable
2014-02-26
04:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would not use a BLOB field, better using a CLOB field. CLOBs can be retrieved as normal varchar fields.
605 Views

Specialist III
2014-02-26
04:54 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would not use a BLOB field, better using a CLOB field. CLOBs can be retrieved as normal varchar fields.
605 Views

Specialist III
2014-02-26
04:55 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would not use a BLOB field, better using a CLOB field. CLOBs can be retrieved as normal varchar fields.
Oops..
Assuming I don't have a choice, what can I do to extract the JSON?
605 Views

Anonymous
Not applicable
2014-02-26
10:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would not use a BLOB field, better using a CLOB field. CLOBs can be retrieved as normal varchar fields.
Oops..
Assuming I don't have a choice, what can I do to extract the JSON?
Read the Blob data from Mysql to a json file first, and then use a tFileInputJson to read the json file, refer to this topic:
https://community.talend.com/t5/Design-and-Development/Image-from-MySQL-to-diretory/td-p/109198
Shong
605 Views

Specialist III
2014-02-27
10:44 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Shong.
We were able to get it into a file by simply connecting it to a tfileoutputdelimited component. Each json object is on a new line. When we try to process this it tries to read the entire file instead of each line. Is this not the right way to do it? Would your previous suggestion be a better approach?
We were able to get it into a file by simply connecting it to a tfileoutputdelimited component. Each json object is on a new line. When we try to process this it tries to read the entire file instead of each line. Is this not the right way to do it? Would your previous suggestion be a better approach?
605 Views
