One Star

Crawling through the Tutorial.

Would anybody mind taking a look at the attached screen shots and advise me where I'm going wrong? The first screen shows a warning and how far I've gotten in the tutorial.
The second shows the mapping and the final the error I'm getting any help is appreciated.
tarting job custload at 22:37 18/06/2009.
Exception in component tMysqlInput_1
java.sql.SQLException: Invalid value for getLong() - 'AL'
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSet.getLong(ResultSet.java:2981)
at com.mysql.jdbc.ResultSet.getLong(ResultSet.java:2926)
at barney.custload_0_1.custload.tMysqlInput_1Process(custload.java:2601)
at barney.custload_0_1.custload.tFileInputDelimited_1Process(custload.java:1435)
at barney.custload_0_1.custload.runJobInTOS(custload.java:2857)
at barney.custload_0_1.custload.main(custload.java:2774)
Job custload ended at 22:37 18/06/2009.
Cheers
Chris
4 REPLIES
One Star

Re: Crawling through the Tutorial.

Well for all those following in my footsteps, the problem is in the tutorial, it says to unclick the id in the component designer.
But could someone explain why this was causing the error?
Chris
One Star

Re: Crawling through the Tutorial.

Next set of errors.
Starting job custload at 00:06 19/06/2009.
connecting to socket on port 3646
connected
Exception in component tMysqlOutput_1
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'state' at row 2
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2936)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1601)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1710)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2436)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1402)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1694)
1|Andrew|Cleveland|South Roosevelt Drive|Thu Jan 20 00:00:00 GMT 2005|55239|
2|Franklin|Jefferson|Carpinteria Avenue|Fri May 19 00:00:00 BST 2006|78148|North Carolina
3|Calvin|Cleveland|Corona Del Mar|Thu Sep 28 00:00:00 BST 2000|77912|Connecticut
4|Grover|Ford|Cleveland Ave.|Tue Nov 27 00:00:00 GMT 2001|76036|
5|Woodrow|Adams|South Highway|Thu Sep 30 00:00:00 BST 2004|56895|Arizona
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1608)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1593)
at barney.custload_0_1.custload.tFileInputDelimited_1Process(custload.java:2231)
at barney.custload_0_1.custload.runJobInTOS(custload.java:2962)
at barney.custload_0_1.custload.main(custload.java:2872)
disconnected
Job custload ended at 00:06 19/06/2009.
When I tried to trim the offending data field it complained that the field was actually null, so I gues it's doing something else, in fact the reference state doesn't exist, so I tried using the inner join so that no value would get returned for 'XX' and the row would be excluded from any output to the customers table but that gave a different error. Can anybosy tell me what's going on?
Cheers
Chris
Community Manager

Re: Crawling through the Tutorial.

Hello
java.sql.SQLException: Invalid value for getLong() - 'AL'

You set the data type as long, but there is a string value in source data.
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'state' at row 2

It's what the error told you : you 're trying to insert data longer than your table field.
For example a string with 25 characters in a database table field with length equals to 20 ...
So you have to modify one or the other , probably the length of your table column. Spetify the length of column when you create a table.
Best regards

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

Re: Crawling through the Tutorial.

I think in all these issues, I need some way to determine where the error is actually occurring?
I sorted the first issue by changing the underlying sql to include the ID, but why was it getting the record by the ID in the first place?
In the second issue, the other way to solve the problem is to cut or substring the field to a given length, is there a function to do that? The tutorial actually says to change the output of out1 to 14 chars, but it doesn't seem to work it's way into the code?
Cheers
Chris