BLOB Columns

From InterBase

Go Up to Defining BLOB Data Types


You define BLOB columns in database tables just as you do non-BLOB columns. For example, the following statement creates a table with a BLOB column:

CREATE TABLE PROJECT
(PROJ_ID PROJNO NOT NULL,
PROJ_NAME VARCHAR(20) NOT NULL UNIQUE,
PROJ_DESC BLOB,
TEAM_LEADER EMPNO,
PRODUCT PRODTYPE,
. . .);

Rather than storing BLOB data directly, a BLOB column stores a BLOB ID. A BLOB ID is a unique numeric value that references BLOB data. The BLOB data is stored elsewhere in the database, in a series of BLOB segments, which are units of BLOB data that are read and written in chunks. InterBase writes data to a BLOB one segment at a time. Similarly, it reads a BLOB one segment at a time.

The following diagram shows the relationship between a BLOB column containing a BLOB ID, and the BLOB data referenced by the BLOB ID:

Advance To: