ODBC Users` Manual

Add to My manuals
280 Pages

advertisement

ODBC Users` Manual | Manualzz

LOB Data Types

LOB Data Types

The following table shows SQL data type identifiers that support LOB:

SQL

TypeIdentifier

SQL_BLOB

SQL_CLOB

Data Type

BLOB

CLOB

Description

BLOB is a binary data type with a variable length.

CLOB is a character data type with a variable length.

The following table shows C data type identifiers that support LOB. It lists C data type of ODBC for each identifier and their definition.

C Type Identifier

SQL_C_BLOB_LOCATOR

SQL_C_CLOB_LOCATOR

ODBC C Type

SQLUBIGINT

SQLUBIGINT

C Type Definition unsigned _int64 unsigned _int64

The name of a 64-bit integer type may vary depending on platform. The _int64 shown in the above table is the name of a 64-bit integer that is used in several platforms including Windows.

Use SQL_C_CHAR for CLOB data and SQL_C_BINARY for BLOB data to bind user variables.

To obtain a LOB locator, bind SQL_C_CLOB_LOCATOR or SQL_C_BLOB_LOCATOR appropriately based on the LOB column type. A LOB locator in this context, – a LOB location input scheme – is a handle that is used during LOB data operation like a file pointer in an operating system.

The LOB location input scheme for Read can be obtained after SELECT LOB column name FROM table where… and select are executed. The LOB location input scheme for Write can be obtained after SELECT LOB column name FROM table where… FOR UPDATE are executed.

Since a LOB location input scheme refers to LOB data at a certain point in relation to MVCC, it has the same life cycle with the transaction that has created itself. Therefore, to perform LOB operation with a LOB location input scheme, a connection should be always established in Non-Autocommit Mode.

Care must be taken as there is no LOB type of a user variable such as SQL_C_BLOB or SQL_C_CLOB.

ODBC Users’ Manual 176

advertisement

advertisement

Table of contents