One Star dn1
One Star

tAS400Input data type mismatch

I have exception in component tAS400Input:
java.sql.SQLException: Data type mismatch. (For input string: "01/01/09")
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:528)
at com.ibm.as400.access.SQLVarchar.getFloat(SQLVarchar.java:486)
at com.ibm.as400.access.AS400JDBCResultSet.getFloat(AS400JDBCResultSet.java:2869)
Thank you
9 REPLIES
Community Manager

Re: tAS400Input data type mismatch

Hello
java.sql.SQLException: Data type mismatch. (For input string: "01/01/09")

What's the data type of this column? int or Date? as the string "01/01/09" display, it should be Date type here.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star dn1
One Star

Re: tAS400Input data type mismatch

The input type is integer and output type is date(dd/mm/yy)

Best regards,
dn
Community Manager

Re: tAS400Input data type mismatch

Hello
As the error message shows, it is a string ""01/01/09" in the table, so you need set the input type as string and convert string type to Date or set it as Date type.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star dn1
One Star

Re: tAS400Input data type mismatch

Hello,
The input type is string and output type is date. In tMap I used TalendDate.parseDate("dd/mm/yy",row13.H_TRDJ).
I have exception on component tAS400Input Data type mismatch. (For input string: "01/01/09") .

Best regards.
dn
Smiley Sad
Community Manager

Re: tAS400Input data type mismatch

Hello
at com.ibm.as400.access.SQLVarchar.getFloat(SQLVarchar.java:486)
at com.ibm.as400.access.AS400JDBCResultSet.getFloat(AS400JDBCResultSet.java:2869)

Can you upload a screenshot of schema of tAS400Input? From the error message, I see the data type is float.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star dn1
One Star

Re: tAS400Input data type mismatch

Hello,
I fix this problem I don't have anymore this error but when I check what is date on database isn't the format dd/mm/yy.
Best regards,
dn
Community Manager

Re: tAS400Input data type mismatch

Hello
but when I check what is date on database isn't the format dd/mm/yy.

Do you point to the target db? Which type of DB?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star dn1
One Star

Re: tAS400Input data type mismatch

Hello Shong,
The name of field is TRDJ and for output I put date which format dd/mm/yy like you can see in the previous image.
The database is Microsoft SQL i have the same field TRDJ and is datetime(see image 2) but when see what is data on db i see yyyy-mm-dd 00:00:00.000(see image 1)
Best regards,
dn
Community Manager

Re: tAS400Input data type mismatch

Hello
It is a display format problem in Microsoft SQL tool, yyyy-mm-dd 00:00:00.000 is the default format of datetime type in Microsoft SQL. If you want to see format dd/mm/yy, you should use convert function in Microsoft SQL tool.
For example:
select convert(varchar(12),TRDJ,3) from tableName;
Please search ms sql datetime format on google.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business