5 Replies Latest reply: Mar 8, 2013 6:19 AM by 995680 RSS

    Arithmetic operation resulted in an overflow

    421762
      Hello everyone,

      I have searched through this forum only to find many dead ends on this topic Currently we are trying to to populate a dataset and in most cases it works flawlessly. In the past couple of days, we have encountered an error from the latest odp.net that is putting a stranglehold on our efforts.

      I have discussed this with the dbm an he assures me that the numbers in question are only a 14/4 precision but when we try to access it, we get this;

      Error filling dataset
      Arithmetic operation resulted in an overflow.
      at Oracle.DataAccess.Types.DecimalConv.GetDecimal(IntPtr numCtx)
      at Oracle.DataAccess.Client.OracleDataReader.GetDecimal(Int32 i)
      at Oracle.DataAccess.Client.OracleDataReader.GetValue(Int32 i)
      at Oracle.DataAccess.Client.OracleDataReader.GetValues(Object[] values)
      at System.Data.Common.SchemaMapping.LoadDataRow(Boolean clearDataValues, Boolean acceptChanges)
      at System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping mapping)
      at System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
      at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
      at Oracle.DataAccess.Client.OracleDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
      at Oracle.DataAccess.Client.OracleDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
      at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

      This data is not that complex so I am wondering why odp.net is suddenly choking to death on this small value. It can physically populate the value so why can't it read it back?

      Any help will be greatly appreciated.
        • 1. Re: Arithmetic operation resulted in an overflow
          455016
          Hello,

          I've strictly the same problem, and currently have no workarround.

          I've also tried with IDataReader and got the following exception (french error message):

          Erreur interne du fournisseur de données(-3000)

          [OracleException: Erreur interne du fournisseur de données(-3000)]
          Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) +523
          Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) +2296
          Oracle.DataAccess.Client.OracleCommand.ExecuteReader() +95
          Nemo.WebApplication.perso.gseg.arithmeticoverflow.Page_Load(Object sender, EventArgs e) in ...\arithmeticoverflow.aspx.cs:41
          System.Web.UI.Control.OnLoad(EventArgs e) +67
          System.Web.UI.Control.LoadRecursive() +29
          System.Web.UI.Page.ProcessRequestMain() +713

          Thanks for your support.
          • 2. Re: Arithmetic operation resulted in an overflow
            439143
            Hi d.daniels. You could try using the Safe Type Mapping feature. See ODP.NET docs for more info.
            • 3. Re: Arithmetic operation resulted in an overflow
              211536
              Daniel,

              Today I have got the same error while trying to fill DataSet by using DataAdapter.Fill() method. Error message:
              Arithmetic operation resulted in an overflow.
              at Oracle.DataAccess.Types.DecimalConv.GetDecimal(IntPtr numCtx)
              at Oracle.DataAccess.Client.OracleDataReader.GetDecimal(Int32 i)
              at Oracle.DataAccess.Client.OracleDataReader.GetValue(Int32 i)
              at Oracle.DataAccess.Client.OracleDataReader.GetValues(Object[] values)
              at System.Data.Common.SchemaMapping.LoadDataRow(Boolean clearDataValues, Boolean acceptChanges)
              at System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping mapping)
              at System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
              at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
              at Oracle.DataAccess.Client.OracleDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
              at Oracle.DataAccess.Client.OracleDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
              at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

              I have search the Web and have come across your posting on Oracle. Looks like this is the same problem and I wanted to ask you if you have found the solution for this problem. I’m a week from Production Deployment and this looks like will be a “Good” surprise in holiday time.

              Happy Holiday.

              Thanks,
              Daniel
              • 4. Re: Arithmetic operation resulted in an overflow
                421762
                We found that this is caused by a return value that has more places to the right of the decimal point than .NET can handle. We just truncated the offending return value down to a reasonable 14.4 decimal and all is well now. The original function return wound up being precision 24.14 even though I was told otherwise. Be careful of functions that return calculated values. They sometimes try to return a larger number than even ODP.NET can handle.

                Hope this is some help.

                Message was edited by:
                d.daniels@smmj.com
                • 5. Re: Arithmetic operation resulted in an overflow
                  995680
                  Yes, I agree with daniels.
                  if database decimal column value has more than 3 digits like 93.4065934065934 or -Infinity, application throws "Arithmetic operation resulted in an overflow" error.
                  it needs to be corrected.