isc_blob_set_desc2()

From InterBase

Go Up to API Function Reference


Sets the subtype and character set for a Blob. For more information about Blob descriptors, see Working with Blob Data.

Syntax

 ISC_STATUS isc_blob_set_desc2(
 ISC_STATUS *status_vector,
 unsigned char *table_name,
 unsigned char *column_name,
 short subtype,
 short charset,
 short segment_size,
 ISC_BLOB_DESC_V2 *desc);
Parameter Type Description

status_vector

ISC_STATUS *

Pointer to the error status vector

table_name

unsigned char *

Name of the table containing the Blob column

column_name

unsigned char *

Name of the Blob column in the table

subtype

short

Specifies the subtype of the Blob; value are:

  • InterBase-defined subtype values, 0 or 1 (TEXT).
  • User-defined subtypes, –1 to –32768.

charset

short

Specifies the character set for the Blob.

segment_size

short

Specifies the segment size for the Blob.

desc

ISC_BLOB_DESC *

Pointer to a Blob descriptor to populate

Description

isc_blob_set_desc2() sets the Blob column name, table name, subtype, segment size, and character set for a Blob column to values specified by the application. To set these values to InterBase defaults, use isc_blob_default_desc2().

isc_blob_set_desc2() and three related functions, isc_blob_default_des2c(), ­isc_blob_gen_bpb2(), and isc_blob_lookup_desc2() provide dynamic access to Blob data. In particular, you can use these functions to define and access information about Blob data for filtering purposes, such as character set information for text Blob data, and subtype information for text and non-text Blob data.

You can manually set the subtype and character set information (for a TEXT subtype) in a Blob descriptor, by way of a call to isc_blob_set_desc2(). Pass the subtype, character set, and segment size to the Blob descriptor in your application.

isc_blob_set_desc2() is useful for setting the contents of the Blob descriptor without querying the system tables for the information. Calls to this function also let an application specify character set and subtype for custom filtering operations.

Note: The ISC_BLOB_DESC_V2 structure supports long metadata names of length METADATALENGTH. The older ISC_BLOB_DESC structure supports only metadata names of 32 bytes or less.
Note: Do not call this function while running against a V3.x database.

Example

The following example sets the default values for a tour guide application, including subtype, character set, and segment size:

isc_blob_set_desc2(status, "TOURISM", "GUIDEBOOK", 1, 2, 80, &desc);

Return value

isc_blob_set_desc2() returns the second element of the status vector. Zero indicates success. A nonzero value indicates an error. For InterBase errors, the first element of the status vector is set to 1, and the second element is set to an InterBase error code.

To check for an InterBase error, examine the first two elements of the status vector directly. For more information about examining the status vector, see Handling Error Conditions.

See Also

Advance To: