Using tOracleinput for migrating CLOB data

One Star

Using tOracleinput for migrating CLOB data

Here is a brief description of the components used in a simple migration of Oracle data into a MySQL MyISAM table:
tOracleinput (contains one CLOB column) --> tMap --> TMysqlOutput (with a longtext column for the CLOB data)
We are using TIS 4.0.3 and this results in an error "cannot convert from Object to String" since the CLOB database column is represented as an Object type in Talend and the MySQL longtext column is represented as a String in Talend.
I am hoping that there is someone in this forum that has encountered this issue and has found a resolution. I have used many search terms and did not find any close hits.
Thanks.
Employee

Re: Using tOracleinput for migrating CLOB data

Hi evdios,
I guess you'll have to convert the Object into a String in Java.
Here is an example on how to do so:
http://stackoverflow.com/questions/2169732/most-efficient-solution-for-reading-clob-to-string-and-st...
One Star

Re: Using tOracleinput for migrating CLOB data

Thanks, vgalopin for your response. I am glad I posted this in the forum because I am still waiting for Talend Support's reply to my support request (we have TIS).
I am not a java expert so any help in how I can use the example you provided will be appreciated. Do I create a Talend Routine?
Thanks.
One Star

Re: Using tOracleinput for migrating CLOB data

I had a similar problem earlier. I tried changing data type to String from Object in schema it works!!
Employee

Re: Using tOracleinput for migrating CLOB data

evdios,
Yes I would create a routine, and replace the sample function that's in there by the code from my link.
One Star

Re: Using tOracleinput for migrating CLOB data

Venkateshs' method is easier.
Employee

Re: Using tOracleinput for migrating CLOB data

Well only if you are able to modify the target schema, I was just considering that the target table already exists and cannot be modified.
One Star

Re: Using tOracleinput for migrating CLOB data

As a matter of fact, the target schema already exists in our case and therefore we followed vgalopin's solution. I just asked for a little help from one of our java folks and we walked through the creation of the custom routine. My realm of expertise is more on the DB-sql-plsql-etc side of things; my java is rusty at best.
Thanks a lot to all who assisted here.
One Star

Re: Using tOracleinput for migrating CLOB data

Well only if you are able to modify the target schema, I was just considering that the target table already exists and cannot be modified.

It's the source schema that needs the change so that can be done in the Talend component without affecting the database.
One Star

Re: Using tOracleinput for migrating CLOB data

Thanks venkatesh and janhess as well. That worked and it is much simpler. Do any of you know what the length limit might be on the String type?