Feedback
Did this article resolve your question/issue?

   

Article

SQLColumns returns incorrect buffer length for ODBC DB2 driver

Information

 
TitleSQLColumns returns incorrect buffer length for ODBC DB2 driver
URL NameSQLColumns-returns-incorrect-buffer-length-for-ODBC-DB2-driver
Article Number000111509
EnvironmentProduct: Connect64 for ODBC DB2 Wire Protocol driver
Version: 07.16.0285
OS: Windows
Database: DB2 10.5
Application: All supported applications
Question/Problem Description
SQLColumns returns incorrect Buffer length for a column defined as VARCHAR(8 CODEUNITS32)
 
Steps to ReproduceWith DB2 10.5 or 11 version database.

1 - Open ‘ODBC Test’ application
2 - CREATE TABLE ngtest( ACCNO VARCHAR(8 CODEUNITS32))
3 - Go to menu option Catalog -> SQL Columns
4 - Provide table namein capital letters
5 - Go to menu option Results -> Get Data All
6 - Observed output with Datadirect driver:
Get Data All:"TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE" , "DB2ADMIN", "NGTEST", "ACCNO", 12, "VARCHAR", 8, 8, , , 1, , , 12, , 8, 1, "YES" 1 row fetched from 18 columns.

7 - Follow same stesps (1-5) with native driver and observed output with native DB2 driver:
Get Data All: "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE" , "DB2ADMIN", "NGTEST", "ACCNO", 12, "VARCHAR", 8, 32, , , 1, , , 12, , 32, 1, "YES"1 row fetched from 18 columns.
Clarifying Information
Buffer length validation missing for datatype CODEUNITS32.
 
Error Message
Defect NumberDefect XDBC-8233
Enhancement Number
Cause
Resolution
Fixed in hot fix 07.16.0297.
Refer to  Connect and Connect64 for ODBC hot fix download and install instructions for instructions on how to download and install the hot fix.
Workaround
Notes
Last Modified Date11/20/2020 7:05 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.