I have a field with varchar (100) in mysql, I want to save the first 100 characters, because my data length is 200 characters (ignore the last 100 characters). I do not want to change my source code. It is possible in MS-Access and MS Server, but I want to do it in mysql.
I apply this in java with hibernate, which means I am not writing code for input. Here I just use the save () method and drop the "Big Data".
I have an Exception -
Called: java.sql.BatchUpdateException: Data Truncation: Data for column "FBUrl" on row 1 is too long at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1527)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1065)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
glb.chatmeter.exception.AdException: Could not Save Facebook page Data.
source
share