Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

java.sql.DataTruncation: Data truncation I have this error?

I have the following job:


I read a table from a firebird database and I insert the rows in the same table.
So the metadata of the input table and the output are the same because it is the same table.
and I have 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.insertarticles_0_1.InsertArticles.tFirebirdInput_1Process(InsertArticles.java:8999)
    at pmi.insertarticles_0_1.InsertArticles.runJobInTOS(InsertArticles.java:11574)
    at pmi.insertarticles_0_1.InsertArticles.main(InsertArticles.java:11392)

So why I have this error??
Thanks
Didier
Labels (4)
2 Replies
Anonymous
Not applicable
Author

The issue is on the following field:


so I have trie to add :
row1.ARCTLIB01.substring(0,30)
in the tmap:


And now I get:
Démarrage du job InsertArticles a 09:33 03/02/2016.
connecting to socket on port 3346
connected
Exception in component tMap_1
java.lang.StringIndexOutOfBoundsException: String index out of range: 30
    at java.lang.String.substring(Unknown Source)
    at pmi.insertarticles_0_1.InsertArticles.tFirebirdInput_1Process(InsertArticles.java:8444)
    at pmi.insertarticles_0_1.InsertArticles.runJobInTOS(InsertArticles.java:11299)
    at pmi.insertarticles_0_1.InsertArticles.main(InsertArticles.java:11117)
disconnected

an idea???
Anonymous
Not applicable
Author

No way to insert data in the field
I have done the following test:
StringHandling.LEN(row1.ARCTLIB01)<29?row1.ARCTLIB01:row1.ARCTLIB01.substring(0,20)


I have still:
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.insertarticles_0_1.InsertArticles.tFirebirdInput_1Process(InsertArticles.java:8964)
    at pmi.insertarticles_0_1.InsertArticles.runJobInTOS(InsertArticles.java:11658)
    at pmi.insertarticles_0_1.InsertArticles.main(InsertArticles.java:11476)

I have tried to increase the size of the target field. Same error!

I don't know what to do !!