Oracle: Arithmetic operation resulted in an overflow

12,295

Solution 1

Shoot now I recall that I have seen this before. The Oracle client is 32-bit only. And so my .NET app needs to be x86 compiled. So annoying! And the message is so deceptive.

Solution 2

http://blogs.msdn.com/b/mariae/archive/2012/07/05/quot-arithmetic-operation-resulted-in-an-overflow-quot-error-running-a-report-that-uses-a-connection-data-source-to-oracle-10.aspx

bug in the Oracle ODBC driver. It affects the versions: 10.2.0.4 to 11.2.0.1 of Oracle and only the 64 bit driver (not the 32 bit driver).

Edit (Jan 2022): link from MSDN went dead. Here's a link to the Oracle page: https://support.oracle.com/knowledge/Oracle%20Database%20Products/1181253_1.html

Share:
12,295
Daniel Williams
Author by

Daniel Williams

I love coding! The way I get to do what I love is by specializing in integration data between Project Management and ERP systems. For example, I integrate Primavera with JD Edwards. Or PeopleSoft, or Timberline, or, heck, even an Excel spreadsheet. And I write tools and wrapers to make the user experience better with these systems. Most of the work I do is for the Windows environment, so in C# and IIS on the server side. Recently I've been doing a lot of SPA work, so learning alot of JavaScript and that whole ecosystem of libraries and tools. It's pretty fun, and often blows my poor statically-typed, object-oriented mind!

Updated on June 18, 2022

Comments

  • Daniel Williams
    Daniel Williams almost 2 years

    My query pulls two strings - no numeric types at all, yet the Oracle client gives me the exception above. Any ideas?

    Here is the query - all fields are strings:

     SELECT project_name 
            , project_title
            , project_name as Job2   
            , project_name as Job1  
     FROM PROJ
    

    Here is the exception:

    System.OverflowException: Arithmetic operation resulted in an overflow.
       at System.Data.Odbc.OdbcDataReader.FirstResult()
       at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
       at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
       at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior)
       at System.Data.Odbc.OdbcCommand.ExecuteDbDataReader(CommandBehavior behavior)
       at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
       at Partners.Core.Data.Database.FillDataSet(DataSet& dataSet, IDbCommand command, String[] tableNames) in c:\Dropbox\svn\partners\libraries\internal\Partners.Core\Data\Database.cs:line 999
    
  • BrandonG
    BrandonG over 10 years
    Your solution worked for a similar issue. I was getting this error on IIS 8 where the app pool did not allow 32 bit applications. Some I set that property to true, the error went away. Thanks!
  • Der Kommissar
    Der Kommissar over 8 years
    Just to add a little more information: if you are deploying to a server with IIS 8, and Sharepoint 2013, the "Enable 32-Bit Applications" flag won't work by default, and will instead crash your application. This article has a fully working solution. (I came across this problem with our IBM System i at work, and the IBM driver for it.)