One Star

getInt: conversion error

Hi,
I want to just simply export data from Teradata to csv file. I used tTeradataInput and linked it to tFileOutputDelimited. However, If I have city column included in the query used then I receive the below error, if I exclude the column everything is working without problem. I checked that the data is string and checked that other text columns are working. Coudl you please provide my with the solution?
Exception in component tTeradataInput_1
java.sql.SQLException: TeraResultSet:getInt: conversion error (Lens-Douai-Arras)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeLegacyDriverException(ErrorFactory.java:179)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeLegacyDriverException(ErrorFactory.java:173)
at com.teradata.jdbc.ComUtil.ThrowExcp(ComUtil.java:1539)
at com.teradata.jdbc.TeraResultSet.internalGetInt(TeraResultSet.java:208)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalResultSet.getInt(TeraLocalResultSet.java:285)
at second.t2_0_1.t2.tTeradataInput_1Process(t2.java:1806)
at second.t2_0_1.t2.runJobInTOS(t2.java:3105)
at second.t2_0_1.t2.main(t2.java:2973)
Best regards,
Rafa?
5 REPLIES
Community Manager

Re: getInt: conversion error

Hi
Could there be some null values in this column?
I'm not sure you'd get this exception though.
regards,
Elisa
Seventeen Stars

Re: getInt: conversion error

You talking about your column is a String type but you try to read the value as Integer.
Please keep in mind, not the name of the schema column is used to parse the result set, it is the position of the column in the schema. Check if the schema columns are in the same order like in your query.
Moderator

Re: getInt: conversion error

Hi Rafa?,
A screenshot of your schema setting will be helpful for us to address your issue.
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.
One Star

Re: getInt: conversion error

Thanks to all of you for your replies.
@jlolling Your answer was key to my problem. Indeed the order of schema was different from the order of query. I solved it using guess schema but then I learned how to change the order by myself (it is unintuitive). In both repository and biult-in option I used edit shchem, untick the column then move it and click ok. I am not sure if I do it correctly? Additionally, could you explain me what the ticked key field means and why I need untick it so that the changed order is saved?
Best regards,
Rafa?
Seven Stars

Re: getInt: conversion error

The key checkbox has meaning only to certain components, most commonly the various DB output components which use the "key" fields for the "where" clause when doing updates or deletes.
You should not need to untick it to move the field but note that moving fields in the schema has no effect on the query. If you don't update the query too then you will get problems like this.