One Star

Data truncation

Hello,
I have the following configuration :
Talend Data Integration V5.6RC
1 firebird dabase with 1 table
I am testing the following job:
update the data of the table A by the data of the same table:


the output table is defined as:


When I execute the job, I get the following error:
Exception in component tFirebirdOutput_1
java.sql.DataTruncation: Data truncation
    at org.firebirdsql.jdbc.field.FBWorkaroundStringField.setString(FBWorkaroundStringField.java:97)
    at org.firebirdsql.jdbc.AbstractPreparedStatement.setString(AbstractPreparedStatement.java:384)
    at pmi.test2_0_1.test2.tFirebirdInput_1Process(test2.java:9374)
    at pmi.test2_0_1.test2.runJobInTOS(test2.java:11152)
    at pmi.test2_0_1.test2.main(test2.java:11011)

Why  I have this error if I have the SAME table on the both side?
Thanks
Didier
8 REPLIES
One Star

Re: Data truncation

Hi Dihonore
Data truncation error usually comes when you define inconsistent length of your columns in your input and output.Make sure length of each column is atleast same in both input and output.
For more clarification suppose your input column "name" has length 20 and output column "name" has length 10,then it will truncate any name coming from input of length greater than 10.
Hope it helps
Thanks
Seventeen Stars

Re: Data truncation

hi,
check that you have explicitely put length to your column in your flow .
When length are not specified a dafault value is using at creation table.
regards
laurent
ps : crossing post Smiley Wink
One Star

Re: Data truncation

I agree but the output table is the input table
There is only one table!!
So there is only one data structure. So the length cannot be different in the output table compared to the input table!
Seventeen Stars

Re: Data truncation

Talend guess attributes of a column on the 50th lines.
I think that you have data longer thant those detected by talend.
Profile your data to find 'real length'.
regards
One Star

Re: Data truncation

I have just done a test with 2 fields :

http://www.talendforge.org/forum/img/members/230532/mini_blob_20141030-0815.png


And I have the same error
And as you can see I have the same data structure on the both side!!
An idea??
One Star

Re: Data truncation

Hi
You are inserting data in the same table(both table are same).Then it depends what operation you are performing on your table such as insert,update,delete or you just trying to append.Do one thing select delete option when you are inserting data to your target table.It will first delete data from your table and then will insert.If you will be trying to append data in target table then it will give truncation error as you are adding same value two time into your column (one already present,one using job),so it might be crossing your length limit.
Hope it helps
Sanjay TIwari
Moderator

Re: Data truncation

Hi,
You can use "Rejects" row from tFirebirdOutput to see what's the truncated data.
Please see a related KB article:TalendHelpCenterSmiley Very Happyata too long for column
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Moderator

Re: Data truncation

Hi dihonore,
Is your issue fixed? Feel free to post your issue here.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.