Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the default value of a BLOB column in mysql? [duplicate]

Is it possible to automatically assigned the value of a BLOB column in MySQL without uploading a file everytime a new line is included?

like image 362
RafaSashi Avatar asked Aug 08 '13 16:08

RafaSashi


People also ask

What is the default value of BLOB in MySQL?

BLOB and TEXT columns cannot have DEFAULT values. Thus, if the column is NULLABLE then NULL is the default; otherwise there is no default value. (Although, at the application level, a blob of length=0 might be a sensible "default".)

What is the default value for BLOB?

An object which may specify any of the following properties: type Optional. The MIME type of the data that will be stored into the blob. The default value is the empty string, ( "" ).

How can I change BLOB data in MySQL?

BLOB Editor is invoked from data grid of any table editor or the result tab of SQL Editor and Visual Query Builder by double clicking of the BLOB field to be edited or with the Edit BLOB link of the field's popup menu. The editor also can be called from BLOB Viewer with the Edit current BLOB button.

What is the use of Longblob in MySQL?

LONGBLOB: A binary large object column with a maximum length of 4294967295 (2^32 - 1) bytes, or 4GB in storage. Each LONGBLOB value is stored using a four-byte length prefix that indicates the number of bytes in the value.


1 Answers

The DEFAULT value clause in a data type specification indicates a default value for a column.

Nevertheless BLOB and TEXT columns cannot be assigned a default value.

From: http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html

like image 130
RafaSashi Avatar answered Oct 05 '22 02:10

RafaSashi