ODBC Driver Returns Wrong Buffer_length Through SQLColumns() API (Doc ID 1290375.1)

Last updated on JULY 05, 2017

Applies to:

Oracle ODBC Driver - Version: 11.2.0.1 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms

SQLColumns return wrong COLUMN_SIZE for a NVARCHAR2/NCHAR column from a SYNONYM
and wrong BUFFER_LENGTH FOR all CHAR type columns, when using char semantics but
not for NVARCHAR2 column from a SYNONYM.

From the ODBC documentation:

COLUMN_SIZE : this column contains the maximum length in characters of the column
BUFFER_LENGTH : should return the number of bytes (like OCI_ATTR_DATA_SIZE)

When specifying VARCHAR2(100 CHAR) on a AL32UTF8 RDBMS, BUFFER_LENGTH is
reported as 100 on the base table which is wrong, and the synonym report the
correct 400 bytes.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms