Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
cjj
Contributor
Contributor

Prepared Statement issue with Character data type

Hi all,
Not sure if I'm being silly, or if I've hit a brick wall on this.
I have a tMysqlRow component that I'm setting up as a prepared statement.  I've defined the parameters (more than a dozen), but it is failing due to the lack of option for a particular parameter type.
I have a 'Character' data field in my MySQL table, and Talend is happy to define and parse this throughout the job... until this point.

As can be seen, there's no capacity to set the field type as 'Character' within the Advanced table of the tMySQL row component.  This, if set to string for example, causes the familiar error:
"The method setString(int, String) in the type PreparedStatement is not applicable for the arguments (int, Character)"
Is this something Talend has overlooked, or am I at fault?
Labels (2)
3 Replies
Anonymous
Not applicable

Hi,
Could you please show us your prepared statement? Screenshot of tMysqlRow will be preferred.
Can you run it successfully in your mysql client?
Best regards
Sabrina
cterenzi
Specialist
Specialist

setString expects a String as the second argument.  Try converting the character field in the parameter settings by using: String.valueOf(myChar)
cjj
Contributor
Contributor
Author

Thanks for the replies - not exactly on topic for what I was asking though.
My main issue was that Talend's prepared statement component does not include a relevant match for a "Character" DB type.


If you have a single character field in a MySQL DB, there is no classification within the component that will match.
Forcing the data to comply with what talend wants will still end up in an issue, as the DB does not want a String - it wants a Character!