Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Batch inserts exception getting thrown..

 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep getting the following error when trying to load data into a table from a file.

ERROR - com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for column 'contentId' at row 64
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for column 'contentId' at row 64


contentId in the tab delimted text file is always null (in the table it is an auto incremented field and this exception is thrown regardless on every file I try to load (although I haven't tried to load a file with less than 64 rows yet). I can't see anything different about row 64 than any other row (and it doesn't regardless of the data set on row 64). And the table seems to load just fine, but then it kicks out an exception screwing up the next steps. I suppose I could catch it and do nothing, though I loathe to do this with out knowing why.


-Tad
 
Scott Selikoff
author
Saloon Keeper
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Going out on a limb, but what was is the data type and size of content id in the database? You could be auto-incrementing past its size if it is small too small.

The error seems like its a data field problem but post mentions that the field is null and irregardless of the data the error comes up. I'd suggest posting your table defintion as well as a few example rows and see if that sheds any light.
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The field is a Bigint (mysql data type). And the input for the field is null b/c its an autoincrementing field. The fields in the input file are tab delimited and I've tried putting '' in and nothing for the id field. The strange thing is it seems to work fine. I guess whats the harm in truncating null data? but its still annoying.

-Tad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic