Blob Descriptors

From InterBase
Jump to: navigation, search

Go Up to Working with Blob Data


A Blob descriptor is used to provide dynamic access to Blob information. For example, it can be used to store information about Blob data for filtering (conversion) purposes, such as character set information for text Blob data and subtype information for text and non-text Blob data. Two Blob descriptors are needed whenever a filter will be used when writing to or reading from a Blob: one to describe the filter source data, and the other to describe the target.

A Blob descriptor is a structure defined in the ibase.h header file as follows:

typedef struct {
short blob_desc_version /* version of descriptor */
short blob_desc_subtype; /* type of Blob data */
short blob_desc_charset; /* character set */
short blob_desc_segment_size; /* segment size */
unsigned char blob_desc_field_name [METADATALENGTH]; /* Blob column name */
unsigned char blob_desc_relation_name [METADATALENGTH];   /* table name */
} ISC_BLOB_DESC_V2;
Note: ISC_BLOB_DESC_V2 accommodates 68-byte metadata names. The older ISC_BLOB_DESC descriptor accommodates only 32-byte names. It is retained for backward compatibility and will be removed at some point in the future.

The blob_desc_version field is set to BLB_DESC_CURRENT_VERSION by isc_blob_default_desc2(), isc_blob_lookup_desc2(), and isc_blob_set_desc2(). isc_blob_gen_bpb2() requires that you manually set the blob_desc_version field to BLB_DESC_CURRENT_VERSION.

METADATALENGTH is defined in ibase.h.

For more information about the character sets recognized by InterBase, see the Language Reference Guide.

The segment size of a Blob is the maximum number of bytes that an application is expected to write to or read from the Blob. You can use this size to allocate your own buffers.

The blob_desc_relation_name and blob_desc_field_name fields contain null-
terminated strings.

Advance To: