File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

data to long for column

 
egbai mmumene
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Been working on my application but keep receiving an error message saying data too long for column tried to change data types nothing works out.
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This error message usually mean the text you're trying to write to a column is longer than the maximum width of the column. The same error might also mean that a numeric value is bigger than what a numeric column will allow, and some other types (LOBs, for example, might probably produce similar messages, depending on your DB).

Does the error message at least specify the column name? In that case, have a good look on the definition of that column in the database, and inspect the value your're writing to it correctly. In case of text column it can still be troublesome, as some databases measure length of columns in bytes, not characters, and using a multi-byte character set may mean that the value will be too long even if the number of its characters does not exceed the width of the column.

If you're unlucky to use a database which does not include the name of the column in the error message, it's a lot more of work, but generally you'll just inspect every column and value you're trying to insert as described in the previous paragraph.

If you're unable to sort it out yourself, then please post your code, the description of your table, which database are you using and the full text of the error message. Perhaps someone acquainted with the database will be able to offer some specific advice.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic