PRB: Numeric Value Out of Range Error with MS Oracle ODBC Driver Version 2.5 or Higher

ID: Q199293


The information in this article applies to:


SYMPTOMS

A client application may receive the following error when using Msorcl32.dll version 2.5 (build 2.573.2927 or higher):

[Microsoft][ODBC Driver for Oracle]Error in column #: Numeric value out of range.


CAUSE

The earlier versions of the driver return hard-coded values for precision and scale when the Oracle database does not return these values. In the Oracle ODBC driver version 2.5, these values are set to zero in such cases according to the ODBC specifications.

In such cases, some applications that depend on these values usually bind the columns in the resultset to the lowest possible datatype (integer) for numeric datatypes. When the values go out of range for these data columns, the Oracle driver throws the error message.

For example, do the following:

  1. Create a sequence generator using the following code:


  2. 
    Create SEQUENCE test_seq
    INCREMENT BY 10
    START WITH 32766 
  3. From Microsoft Access (do a pass-through query):
    SELECT test_seq.NEXTVAL FROM SYS.DUAL 


RESULTS: An "ODBC Call failed" is returned and the error above because the next value 32776 is out of range with respect to the integer datatype.


RESOLUTION

To resolve this problem, use one of the following three workarounds:


STATUS

This behavior is by design.


MORE INFORMATION

Additional query words:


Keywords          : kberrmsg kbprg kbDatabase kbDriver kbODBC kbOracle 
Version           : WINDOWS:2.5
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: March 27, 1999