Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


Mimer Specific Descriptor Fields


Mimer SQL supports large objects of up to 8 terabytes. This poses a problem to ODBC applications since the ODBC API specifies length fields to be 32 bits. An ODBC compliant application is therefore unable to work with any objects larger than 2 gigabytes. The SQL/CLI standard has the same problem, so we won't get much help there.

To remedy this situation, the Mimer ODBC driver has four vendor specific descriptor attributes. Each attribute mimics the behavior of an existing attribute, the only difference is that the existing attribute is working with a 32-bit integer while ours use 64-bit integers.

C-definitions for these attributes are available in the mimodbc.h header file. Include this file along with the regular ODBC include files (sql.h, sqlext.h) to gain access to these features.

Note that, although these attributes are most useful when working with large objects, they may be used for any type of data.

These are the extra descriptor attributes:

Record field name
Type
R/W
Default
SQL_DESC_DISPLAY_SIZE_64
SQLBIGINT
ARD: Unused
APD: Unused
IRD: R
IPD: Unused
ARD: Unused
APD: Unused
IRD: D
IPD: Unused
SQL_DESC_LENGTH_64
SQLUBIGINT
ARD: Unused
APD: Unused
IRD: R
IPD: R/W
ARD: Unused
APD: Unused
IRD: D
IPD: ND
SQL_DESC_OCTET_LENGTH_64
SQLBIGINT
ARD: Unused
APD: Unused
IRD: R
IPD: R/W
ARD: Unused
APD: Unused
IRD: D
IPD: ND
SQL_DESC_OCTET_LENGTH_PTR_64
SQLBIGINT*
ARD: R/W
APD: R/W
IRD: Unused
IPD: Unused
ARD: Null ptr
APD: Null ptr
IRD: Unused
IPD: Unused

SQL_DESC_DISPLAY_SIZE_64 [IRDs]

This read-only SQLBIGINT record field contains the maximum number of characters required to display the data from the column. The value in this field is not the same as the descriptor field SQL_DESC_LENGTH because the SQL_DESC_LENGTH field is undefined for all numeric types.

SQL_DESC_LENGTH_64 [Implementation descriptors]

This SQLUBIGINT record field is either the maximum or actual character length of a character string or a binary data type. It is the maximum character length for a fixed-length data type, or the actual character length for a variable-length data type. Its value always excludes the null-termination character that ends the character string. For values whose type is SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, or one of the SQL interval data types, this field has the length in characters of the character string representation of the datetime or interval value. Note that this field is a count of characters, not a count of bytes.

The value in this field may be different from the value for "length" as defined in ODBC 2.x. For more information, see Microsoft ODBC 3.0 Programmer's Reference, Appendix D, "Data Types."

SQL_DESC_OCTET_LENGTH_64 [Implementation descriptors]

This SQLBIGINT record field contains the length, in bytes, of a character string or binary data type. For fixed-length character or binary types, this is the actual length in bytes. For variable-length character or binary types, this is the maximum length in bytes. This value always excludes space for the null-termination character.

SQL_DESC_OCTET_LENGTH_PTR_64 [Application descriptors]

This SQLBIGINT* record field points to a variable that will contain the total length in bytes of a dynamic argument (for parameter descriptors) or of a bound column value (for row descriptors).

For an APD, this value is ignored for all arguments except character string and binary; if this field points to SQL_NTS, the dynamic argument must be null-terminated. To indicate that a bound parameter will be a data-at-execution parameter, an application sets this field in the appropriate record of the APD to a variable that, at execute time, will contain the value SQL_DATA_AT_EXEC or the result of the SQL_LEN_DATA_AT_EXEC macro. If there is more than one such field, SQL_DESC_DATA_PTR can be set to a value uniquely identifying the parameter to help the application determine which parameter is being requested.

If the OCTET_LENGTH_PTR_64 field of an ARD is a null pointer, the driver does not return length information for the column. When setting the SQL_DESC_OCTET_LENGTH_PTR_64 field to anything other than a null pointer, this field overrides the SQL_DESC_OCTET_LENGTH_PTR field. When both SQL_DESC_OCTET_LENGTH_PTR and SQL_DESC_OCTET_LENGTH_PTR_64 are set to null pointers the driver assumes that character strings and binary values are null-terminated. (Binary values should not be null-terminated, but should be given a length to avoid truncation.)

If the call to SQLFetch or SQLFetchScroll that fills in the buffer pointed to by this field did not return SQL_SUCCESS or SQL_SUCCESS_WITH_INFO, the contents of the buffer are undefined. This field is a deferred field: It is not used at the time it is set, but is used at a later time by the driver to determine or indicate the octet length of the data.


Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX