Array Descriptors
An array descriptor describes an array or array subset to be retrieved or written to the ISC_ARRAY_DESC_V2 structure. ISC_ARRAY_DESC_V2 is defined in the InterBase header file as follows:
typedef struct {
short array_desc_version;
unsigned char array_desc_dtype;
char array_desc_scale;
unsigned short array_desc_length;
char array_desc_field_name [METADATALENGTH];
char array_desc_relation_name [METADATALENGTH];
short array_desc_dimensions;
short array_desc_flags;
ISC_ARRAY_BOUND array_desc_bounds [16];
} ISC_ARRAY_DESC_V2;
ISC_ARRAY_BOUND is defined as:
typedef struct {
short array_bound_lower; /* lower bound */
short array_bound_upper; /* upper bound */
} ISC_ARRAY_BOUND;
Array Descriptor Fields
| Field | Description |
|---|---|
|
|
Set to |
|
|
Data type (see below) |
|
|
Scale for numeric data types |
|
|
Length in bytes of each array element |
|
|
NULL-terminated column name |
|
|
NULL-terminated relation name |
|
|
Number of array dimensions |
|
|
Specifies whether array is to be accessed in row- major or column-major order
|
|
|
Lower and upper bounds for each dimension |
The
ISC_ARRAY_DESC_V2 structure supports long metadata names of length METADATALENGTH. The older ISC_ARRAY_DESC structure supports only metadata names of 32 bytes or less.The array_desc_version field is set to ARRAY_DESC_CURRENT_VERSION by isc_array_lookup_bounds2(), isc_array_lookup_desc2(), and isc_array_set_desc2().
The array_desc_dtype field of an array descriptor must be expressed as one of the data types in the following table:
| array_desc_dtype value | Corresponding InterBase data type |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
An array descriptor contains 16 ISC_ARRAY_BOUND structures, one for each possible dimension. An array with <n> dimensions has upper and lower bounds set for the first <n> ISC_ARRAY_BOUND structures. The number of actual array dimensions is specified in the array_desc_dimensions field of the array descriptor.
When you retrieve data from an array, you supply an array descriptor defining the array slice (entire array or subset of contiguous array elements) to be retrieved. Similarly, when you write data to an array, you supply an array descriptor defining the array slice to be written to.