9 Replies Latest reply: Apr 18, 2013 2:35 PM by Alex.Keh .Product.Manager-Oracle RSS

    ODP.Net Managed Provider Beta: Exception thrown on call to GetOracleDecimal

      * .Net Framework 4.0
      * ODP.Net Managed Provider Beta
      * Oracle 10g Server (
      System.IndexOutOfRangeException: Index was outside the bounds of the array.
         at OracleInternal.Core.OracleNumberCore.IsPositive(Byte[] byteRep)
         at Oracle.ManagedDataAccess.Types.OracleDecimal..ctor(Byte[] numBytes, Boolean bContainsLength)
         at OracleInternal.Common.HelperClass.GetOracleDecimal(OraType oraType, Byte[] bytes, Int32 offset)
         at Oracle.ManagedDataAccess.Client.OracleDataReader.GetOracleDecimal(Int32 i)
      Hi Alex

      i get this exception on an explicit call to GetOracleDecimal for a field of data type ORA_NUMBER in which each of the returned values is null.

      The stored program I'm calling is in a Package and returns a ref cursor.

      This happens after I have successfully iterated many rows of the the returned resultset, successfully calling GetOracleDecimal for the same field.

      For the successful calls to GetOracleDecimal, the OracleDecimal value is {Null} with an InternalByteRepresentation of null.

      I think what might be happening is that for the failing call, the 'raw data' value is an initialised byte array of zero length (i.e. {byte[0]}
      I'm guessing the cause of the throw is because IsPositive is trying to access the first element in an initialised byte array containing no elements?

      The same error is thrown if you try to run the enumerator on the OracleDataReader.

      Please let me know if it isn't appropriate to post this here or if you would like me to post a ticket on metalink.

      Kind regards


      PS: I can't get the Trace logging to work correctly.
      * relative path file system location ending in '\' doesn't work
      * when '\' omitted, file is written in .\..\ and directory name is concatenated with file name.
      * OracleTraceLevel.Private logs don't seem to be appearing in log file (I might be mistaken in this.)