Share on Google+Share on Google+

MySQL BLOB

Advertisement
This example illustrates how to create the BLOB type field in table.

MySQL BLOB

This example illustrates how to create the BLOB type field in table.

In this example we create a 'pictures' table with id integer type and image field blob type.

 

Query

 

CREATE TABLE `pictures` (
    `id` int(11) NOT NULL auto_increment, 
    `image` blob, PRIMARY KEY(`id`)
);
 
Output

 

+-------+---------+------+-----+---------+----------------+
| Field | Type    | Null | Key | Default | Extra          |
+-------+---------+------+-----+---------+----------------+
| id    | int(11) | NO   | PRI |         | auto_increment |
| image | blob    | YES  |     |         |                |
+-------+---------+------+-----+---------+----------------+

 

Advertisements

Posted on: December 9, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.