Home | Previous Page | Next Page   Data Manipulation > Using Smart Large Objects > Storing a Smart Large Object in a Database >

Valid Data Types

In the database, you can use either of the following ways to store a smart large object in a column:

CLOB and BLOB Data Types

You can store a smart large object directly in a column that has one of the following data types:

The CLOB or BLOB column holds an LO handle for the smart large object. Therefore, when you select a CLOB or BLOB column, you do not obtain the actual data of the smart large object, but the LO handle that identifies this data. The BLOB and CLOB data types have identical internal representation. Externally, an LO handle is represented as a flat array of bytes with a length of MI_LO_SIZE.

Suppose an employee table has a BLOB column named emp_picture to hold the picture of an employee. Figure 26 shows that in a row of the employee table, the emp_picture column contains an LO handle. This LO handle contains information about the location of the actual employee picture in the sbspace1_100 sbspace.

Figure 26. A Smart Large Object in a Database Column
begin figure description - This figure is described in the surrounding text. - end figure description

The CLOB and BLOB data types are often referred to collectively as smart-large-object data types. For more information on these data types, see the IBM Informix: Guide to SQL Reference.

Opaque Data Type

An opaque data type is a user-defined atomic data type. You can define a field of an opaque data type to be a smart large object. The support functions of the opaque type must perform the conversion between the LO handle in the opaque type and the smart-large-object data in the sbspace. For more information, see Managing the Reference Count.

In Figure 26, the emp_picture column could be an opaque data type named picture instead of a BLOB data type. The picture data type could hold the image in a smart large object in one field of its internal structure and other information about the picture in other fields.

For more information on opaque data types, see the IBM Informix: Guide to SQL Reference and the IBM Informix: User-Defined Routines and Data Types Developer's Guide.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]