
Anonymous
Not applicable
2016-04-12
10:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Talend Capabilities to Extract Oracle CLOB column to other tables
Hello Experts,
We are planing to use talend to handle a JSON data extraction.
It is in data warehouse area and we are currently using Oracle 10g .
Current Scenario:
We have a table having 10 columns in Staging area . Out of these 1 column is CLOB column , where we are getting CLOB data in JSON format from some source systems.
It is easy to load other 9 columns to data warehouse .
The 10th single CLOB column contains 300+ fields , which need to extracted and loaded in to 3 different tables based on conditions .
Summery:
Stage Table (Having an Oracle CLOB column in JSON formatted data)-----> Need to Extract from 1 CLOB column to 300+ columns ------> Need to store some other defined tables.
Could someone please answer:
1. Can I extract this Oracle CLOB column (JSON_DATA) having JSON structured data to other tables. Is this possible in TALEND at all?
2. If yes , could you please provide an example to extract it.
Many Thanks.
We are planing to use talend to handle a JSON data extraction.
It is in data warehouse area and we are currently using Oracle 10g .
Current Scenario:
We have a table having 10 columns in Staging area . Out of these 1 column is CLOB column , where we are getting CLOB data in JSON format from some source systems.
It is easy to load other 9 columns to data warehouse .
The 10th single CLOB column contains 300+ fields , which need to extracted and loaded in to 3 different tables based on conditions .
Summery:
Stage Table (Having an Oracle CLOB column in JSON formatted data)-----> Need to Extract from 1 CLOB column to 300+ columns ------> Need to store some other defined tables.
Could someone please answer:
1. Can I extract this Oracle CLOB column (JSON_DATA) having JSON structured data to other tables. Is this possible in TALEND at all?
2. If yes , could you please provide an example to extract it.
Many Thanks.
428 Views
6 Replies

Anonymous
Not applicable
2016-04-12
01:22 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. Yes you can, it´s possible in talend, talend speaks Java.
2. No, i cant, to timeconsuming, hire a professional
2. No, i cant, to timeconsuming, hire a professional
428 Views

Anonymous
Not applicable
2016-04-12
06:34 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To give you a bit of a helping hand, the Clob data will be returned by Talend as an Object. You will need to cast this to java.sql.Clob. You can do that in a tJavaRow if you like. Something like below (this may need tweaking as I wrote this from memory).....
This will set the clobString column to be a String representation of the clob output. From that, you will need to use String processing to split the String into columns (or, if it holds JSON, you will need to parse that).
I recommend writing yourself a Java routine to process the clob as you wish since this will mean you can control your code in one location.
output_row.clobString = ((java.sql.Clob)input_row.clob).getCharacterStream(1, ((java.sql.Clob)input_row.clob).length());
This will set the clobString column to be a String representation of the clob output. From that, you will need to use String processing to split the String into columns (or, if it holds JSON, you will need to parse that).
I recommend writing yourself a Java routine to process the clob as you wish since this will mean you can control your code in one location.
428 Views

Anonymous
Not applicable
2016-04-13
01:36 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks all.
This casting is not working:
output_row.clobString = ((java.sql.Clob)input_row.clob).getCharacterStream(1, ((java.sql.Clob)input_row.clob).length());
I am getting following attached Error.
Once again , summery :
Stage Table (Having an Oracle CLOB column in JSON formatted data)-----> Need to Extract from 1 CLOB column to 300+ columns ------> Need to store some other defined tables
Many Thanks.
This casting is not working:
output_row.clobString = ((java.sql.Clob)input_row.clob).getCharacterStream(1, ((java.sql.Clob)input_row.clob).length());
I am getting following attached Error.
Once again , summery :
Stage Table (Having an Oracle CLOB column in JSON formatted data)-----> Need to Extract from 1 CLOB column to 300+ columns ------> Need to store some other defined tables
Many Thanks.
428 Views

Anonymous
Not applicable
2016-04-13
01:49 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Import java.sql
428 Views

Anonymous
Not applicable
2016-04-13
04:31 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The error suggests you are using "java.sql.CLOB". This is wrong. You need to use "java.sql.Clob". Case is important in Java.
428 Views

Anonymous
Not applicable
2016-04-14
11:01 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this was not working :
//output_row.JSON_DATA = ((java.sql.Clob)input_row.JSON_DATA).getCharacterStream(1, //((java.sql.Clob)input_row.JSON_DATA).length());
so I used the default code :
//Code generated according to input schema and output schema
output_row.JSON_DATA = input_row.JSON_DATA;
and now it is throwing below error :
Starting job WIP at 14:57 14/04/2016.
connecting to socket on port 4020
connected
java.io.IOException: Illegal character: <S>
java.io.IOException: Illegal character: <S>
331 milliseconds
disconnected
Job WIP ended at 14:57 14/04/2016.
Please sugest.
//output_row.JSON_DATA = ((java.sql.Clob)input_row.JSON_DATA).getCharacterStream(1, //((java.sql.Clob)input_row.JSON_DATA).length());
so I used the default code :
//Code generated according to input schema and output schema
output_row.JSON_DATA = input_row.JSON_DATA;
and now it is throwing below error :
Starting job WIP at 14:57 14/04/2016.
connecting to socket on port 4020
connected
java.io.IOException: Illegal character: <S>
java.io.IOException: Illegal character: <S>
331 milliseconds
disconnected
Job WIP ended at 14:57 14/04/2016.
Please sugest.
428 Views
