FIX: SQLPutData Truncates LONG RAW Data Using Oracle ODBC Driver

ID: Q184806


The information in this article applies to:
  • Microsoft ODBC for Oracle (Build 2.73.7283.03), version 2.0
  • Microsoft ODBC for Oracle (Build 2.73.7269), version 2.0


SYMPTOMS

Using the Microsoft ODBC Driver for Oracle (build 2.73.728303) that ships with MDAC 1.5c causes a SQL_SUCCESS_WITH_INFO message and a "Data Truncated" error when trying to store LONG RAW data with SQLPutData and using SQLBindParameter with the ColumnSize (6th Parameter) set to 0 or less than the actual length of the data. This occurs even though SQLGetInfo for SQL_NEED_LONG_DATA_LEN returns a "No". Also, no data is written to the LONG RAW field.

The problem occurs if you bind the parameter as a SQL_C_BINARY and SQL_BINARY like this:


g_rc = SQLBindParameter(g_hstmt, 1, SQL_PARAM_INPUT, SQL_C_BINARY,
SQL_BINARY, 0, 0, NULL, 0, &cbVal1); 


RESOLUTION

Make the Columnsize parameter of the SQLBindParameter equal to or greater than the actual value of the data length passed in SQLPutData. Upgrade to the Microsoft Oracle ODBC Driver available in Visual Studio 6.0 or Microsoft Data Access Components version 2.0 or later. You can download the MDAC Components from the following Web address:

http://www.microsoft.com/data/


STATUS

This bug has been fixed in version 2.573.2927 of the Microsoft Oracle ODBC Driver.

Additional query words: msoracle kbOracle kbODBC kbDriver

Keywords : kbODBC200bug kbODBC200fix odbcOracle kbGrpMDAC kbGrpODBC
Version : WINDOWS:2.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: August 11, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.