Unloading Smart Large Objects

The database server unloads smart large objects (from BLOB or CLOB columns) into a separate operating-system file for each column, in the same directory on the client computer as the UNLOAD TO file. All the smart blobs in the same column are stored in a single file. The filename has one of these formats:
  • For a BLOB value: blob########
  • For a CLOB value: clob########

In the preceding formats, the pound ( # ) symbols represent the digits of the unique hexadecimal smart-large-object identifier of the first smart large object in the file. The maximum number of digits for a smart-large-object identifier is 17. Most smart large objects, however, would have an identifier with fewer digits.

When the database server unloads the first smart large object, it creates the appropriate BLOB or CLOB client file with the hexadecimal identifier of the smart large object. If additional smart-large-object values are present in the same column, the database server writes their values to the same file, and lists in the UNLOAD TO file ( *.unl) the sbspace, chunk, and page numbers, and smart large object identifier, for each BLOB or CLOB value in the file.

The following example shows an UNLOAD TO file entry for two smart large object values from the same column:
Object # 1
Space Chunk Page = [5,6,3] Object ID = 1192071051

Object #2
Space Chunk Page = [5,6,4] Object ID = 1192071050

both rows unloaded
In an UNLOAD TO file, a BLOB or CLOB column value appears in this format:
start_off,length,client_path
Here start_off is the starting offset (in hexadecimal format) of the smart-large-object value within the client file, length is the length (in hexadecimal) of the BLOB or CLOB value, and client_path is the pathname for the client file. No blank spaces can appear between these values. If a CLOB value is 512 bytes long and is at offset 256 in the /usr/apps/clob9ce7.318 file, for example, then the CLOB value appears as follows in the UNLOAD TO file:
|100,200,/usr/apps/clob9ce7.318|
If a BLOB or CLOB column value occupies an entire client file, the CLOB or BLOB column value appears as follows in the UNLOAD TO file:
client_path
For example, if a CLOB value occupies the entire file /usr/apps/clob9ce7.318, the CLOB value appears as follows in the UNLOAD TO file:
|/usr/apps/clob9ce7.318|

For locales that support multibyte code sets, be sure that the declared size (in bytes) of any column that receives character data is large enough to store the entire data string. For some locales, this can require up to 4 times the number of logical characters in the longest data string.

The database server handles any required code-set conversions for CLOB data. For more information, see the HCL OneDB™ GLS User's Guide.