Sagewire Logo

DataTrunctation error when BLOB/CLOB greater than 64K

2 Message(s) by 2 Author(s) originally posted in mysql java


From: Bill Karwin Date:   Friday, February 24, 2006
wrote in message

Is there a way to lift the restriction on how much data can be written
to a LOB in MySQL from JDBC?



Regardless of JDBC, 64KB is the size limit on the plain BLOB datatype in
MySQL. You can declare the field in the database as a MEDIUMBLOB or
LONGBLOB if you need longer data.

See http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html for
details on the maximum size of respective BLOB types.

Alternately, in MySQL 4.1 and later, you can specify a length argument to
the BLOB type keyword, and it'll promote the field to the BLOB type that
can store that length of data.
For example:

CREATE TABLE mytable (
...
myLongBlobField BLOB(120000),
...
);

The field will be created as a MEDIUMBLOB, since 120KB is too large to fit
in a plain BLOB. A subsequent "SHOW CREATE TABLE mytable" statement shows
the field to be of type MEDIUMBLOB.

Regards,
Bill K.


From: rdifalco Date:   Saturday, February 25, 2006
Is there a way to lift the restriction on how much data can be written
to a LOB in MySQL from JDBC?

R.--
MySQL JAVA Mailing List
For list archives: http://lists.mysql.com/JAVA
To unsubscribe: http://lists.mysql.com/JAVA?unsub=3Dmysql-JAVA@xxxxxxxxxxx



Next Message: Handling numerous rows from SQL query



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional