One Star

Data type mismatch

Hello,
I have a join (lookup) between 2 tables and I have the following error:
Starting job ArticlesUC at 11:46 08/06/2009.
Exception in component tAS400Input_3
java.sql.SQLException: Data type mismatch. (For input string: "BI")
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:528)
at com.ibm.as400.access.SQLChar.getInt(SQLChar.java:486)
at com.ibm.as400.access.AS400JDBCResultSet.getInt(AS400JDBCResultSet.java:2889)
at projet_m3.articlesuc_0_1.ArticlesUC.tAS400Input_3Process(ArticlesUC.java:6398)
at projet_m3.articlesuc_0_1.ArticlesUC.tAS400Input_2Process(ArticlesUC.java:1916)
at projet_m3.articlesuc_0_1.ArticlesUC.runJobInTOS(ArticlesUC.java:8857)
at projet_m3.articlesuc_0_1.ArticlesUC.main(ArticlesUC.java:8770)
Job ArticlesUC ended at 11:47 08/06/2009.
How to debug this type of error??
Thanks
Didier
5 REPLIES
Community Manager

Re: Data type mismatch

Hello
java.sql.SQLException: Data type mismatch. (For input string: "BI")

As the message shows, there is a string in input rows, however the data type of column is int.
To avoid this exception,
Delete this row manually or set the data type as string, then filter this row.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Data type mismatch

With a SQL statement it works.
So the problem is to find the record where there is the mismatch.
The join between the two tables is done on fields defined as character.
Any recommendations??
Thanks
Didier
One Star

Re: Data type mismatch

Change the file definition Char by string , for eatch table you work with.
I allways do this and have no problems. You'll be able to work with
string methods.
Marc
One Star

Re: Data type mismatch

I have changed the char type by string
Now I have another error:
Starting job ArticlesUC at 12:26 08/06/2009.
Exception in component tAS400Input_3
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
at projet_m3.articlesuc_0_1.ArticlesUC.tAS400Input_3Process(ArticlesUC.java:6797)
at projet_m3.articlesuc_0_1.ArticlesUC.tAS400Input_2Process(ArticlesUC.java:1916)
at projet_m3.articlesuc_0_1.ArticlesUC.runJobInTOS(ArticlesUC.java:8898)
at projet_m3.articlesuc_0_1.ArticlesUC.main(ArticlesUC.java:8811)
Job ArticlesUC ended at 12:26 08/06/2009.
One Star

Re: Data type mismatch

Try to make you join in query with the matched fields. Do you use specific code in Tmap for working with array ?
Your message is strange or try to put some screens of your Tmap