Feedback
Did this article resolve your question/issue?

   

Article

Database error messages are truncated with 8.0 ODBC Oracle driver

Information

 
TitleDatabase error messages are truncated with 8.0 ODBC Oracle driver
URL NameDatabase-error-messages-are-truncated-with-8-0-ODBC-Oracle-driver
Article Number000125496
EnvironmentProduct: Progress DataDirect for ODBC
Version: 8.0
OS: All supported platforms
Database: Oracle 12.2
Application: ODBC Test, example
Question/Problem Description
The V8 version (8.00.02.2083) of the 64-bit Oracle Wire Protocol driver seems to be truncating long error messages, whereas the 7.1.6 driver did not. This is against Oracle 12.2 using the 64-bit wire protocol driver for Windows.
Steps to ReproduceSteps to reproduce issue:
1) Create an 8.0 ODBC driver DSN to connect to Oracle 12.2

2) Connect to the DSN using ODBC Test or example

3) SQLExecDirect: CREATE TABLE FOO (BAR NUMBER)

4) SQLExecDirect: CREATE OR REPLACE EDITIONABLE TRIGGER "FOOTRIGGER01" BEFORE INSERT ON FOO FOR EACH ROW
DECLARE
ex_custom EXCEPTION;
PRAGMA EXCEPTION_INIT (ex_custom, -20099);
BEGIN
RAISE ex_custom;
RETURN;
EXCEPTION
WHEN OTHERS THEN
DBMS_APPLICATION_INFO.SET_MODULE(module_name => Null, action_name => Null);
RAISE_APPLICATION_ERROR( -20011, 'This is to test a long error message to be displayed in the application. This is to test a long error message to be displayed in the application. This is to test a long error message to be displayed in the application. This is to test a long error message to be displayed in the application. This is to test a long error message to be displayed in the application. This is to test a long error message to be displayed in the application. This is to test a long error message to be displayed in the application. This is to test a long error message to be displayed in the application.' );
END;

5) SQLExecDirect: ALTER TRIGGER "FOOTRIGGER01" ENABLE;

6) SQLExecDirect: INSERT INTO FOO(BAR) VALUES (1)

Observed Results:
Error message is either truncated or Unexpected Network error is returned.

Expected Results:
The error message should be returned and not be truncated

NOTE: ODBC Test and example have a limit on the error message being displayed that is governed by the SQL_MAX_MESSAGE_LENGTH. Modify the example application to set SQL_MAX_MESSAGE_LENGTH to an appropriate value so that the entire error message can be saved in the error message buffer. With ODBC Test, as the application code cannot be modified, ensure the returned error message length is correct. For the above steps to reproduce, the expected error message length should be 760.
Clarifying Information
To repro, force an error from the database using an ON INSERT trigger, that calls RAISE_APPLICATION_ERROR with a very long error message, then attempt an INSERT from a test app, and capture the returned error message. With the V7.1.6 driver, the entire error message is returned. But with the V8 driver, the error message is truncated. The longer the message, the more it's truncated.
Error Message
Defect NumberDefect XDBC-17347
Enhancement Number
Cause
When a long error message was returned from the database, the driver either truncated the message or returned an unexpected network error message.
Resolution
Fixed in hot fix 08.02.2272 (B0547, U0390).

Refer to "Progress DataDirect for ODBC hot fix download and install instructions" for instructions to download and install the hot fix.
 
Workaround
Use the 7.1 driver.
Notes
Last Modified Date11/20/2020 6:58 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.