Smart large objects

Smart large objects are a category of large objects that support random access to the data, and that are generally recoverable.

The random access feature allows you to seek and read through the smart large object as if it were an operating-system file.

Smart large objects are also useful for opaque data types with large storage requirements. (See the description of opaque data types in Opaque Data Types.) They have a theoretical size limit of 242 bytes and a practical limit that your disk capacity determines.

HCL OneDB™ supports the following smart-large-object data types:

BLOB
Stores binary data. For more information about this data type, see the description on page BLOB data type.
CLOB
Stores text data. For more information about this data type, see CLOB data type.

HCL OneDB stores smart large objects in sbspaces. An sbspace is a logical storage area that contains one or more chunks that store only BLOB and CLOB data. For information about how to define sbspaces, see your HCL OneDB Performance Guide.

When you define a BLOB or CLOB column, you can determine the following large-object characteristics:
  • LOG and NOLOG: whether the database server should log the smart large object in accordance with the current database logging mode.
  • KEEP ACCESS TIME and NO KEEP ACCESS TIME: whether the database server should keep track of the last time the smart large object was accessed.
  • HIGH INTEG and MODERATE INTEG: whether the database server should use sbspace page headers and page footers to detect data corruption (HIGH INTEG), or only use page headers (MODERATE INTEG).

Use of these characteristics can affect performance. For information, see your HCL OneDB Performance Guide.

When an SQL statement accesses a smart-large-object, the database server does not send the actual BLOB or CLOB data. Instead, it establishes a pointer to the data and returns this pointer. The client application can then use this pointer in open, read, or write operations on the smart large object.

To access a BLOB or CLOB column from within a client application, use one of the following application programming interfaces (APIs):
  • From within programs, use the smart-large-object API. (For more information, see the HCL OneDB ESQL/C Programmer's Manual.)
  • From within a DataBlade® module, use the Client and Server API. (For more information, see the HCL OneDB DataBlade API Programmer's Guide.)

For information about smart large objects, see the HCL OneDB Guide to SQL: Syntax and HCL OneDB Database Design and Implementation Guide.