BLOB data type

The BLOB data type stores any kind of binary data in random-access chunks, called sbspaces. Binary data typically consists of saved spreadsheets, program-load modules, digitized voice patterns, and so on. The database server performs no interpretation of the contents of a BLOB column.

A BLOB column can be up to 4 terabytes (4*240 bytes) in length, though your system resources might impose a lower practical limit. The minimum amount of disk space allocated for smart large object data types is 512 bytes.

The term smart large object refers to BLOB and CLOB data types. Use CLOB data types (see page CLOB data type) for random access to text data. For general information about BLOB and CLOB data types, see Smart large objects.

You can use these SQL functions to perform operations on a BLOB column:
  • FILETOBLOB copies a file into a BLOB column.
  • LOTOFILE copies a BLOB (or CLOB) value into an operating-system file.
  • LOCOPY copies an existing smart large object to a new smart large object.

For more information about these SQL functions, see the HCL OneDB™ Guide to SQL: Syntax.

Within SQL, you are limited to the equality ( = ) comparison operation and the encryption and decryption functions for BLOB data. (The encryption and decryption functions are described in the HCL OneDB Guide to SQL: Syntax.) To perform additional operations, you must use one of the application programming interfaces (APIs) from within your client application.

You can insert data into BLOB columns in the following ways:
  • With the dbload utility
  • With the LOAD statement (DB-Access)
  • With the FILETOBLOB function
  • From BLOB (ifx_lo_t) host variables ()

If you select a BLOB column using DB-Access, only the string <SBlob value> is returned; no actual value is displayed.