One Star

text file to clob

In talend, I want to read set of a text files and insert into oracle db as clob type using java?
How to convert text file to clob ?
Any help appreciated .
1 REPLY
Seventeen Stars

Re: text file to clob

It can be done this way:
Use the tFileInputDelimited and configure row separator and field separator with values never exists in your file. This way, this component reads the whole file.
Configure the schema to have only one column (e.g. name it content and use String as type).
I guess your target table has a key field? - I would suggest using a key field, your file name looks like a nice key.
tFileInputDelimited ---> tMap (set values for your key field) ----> tOracleOutput
This subjob should be called within a iteration from tFileList.
Now your job reads all files from a directory and stores them in the oracle table.
For this use case in the tOracleOutput I would strongly recommend switch off the batch processing and use 1 as commit size.