Numeric Precision Error
577013May 17 2007 — edited Jun 6 2007Hi,
I am using ODP 10.2.0.2.21 with c# and .Net 2.0 and Oracle 10g.
Most of my stored procedures output the results back to the caller in the form of a generic REF CURSOR. When I call OracleDataAdapter.Fill to populate a data-set using a call to one of these stored procedures, it works fine as long as the stored procedure returns data. If no rows are returned, I get the following error:
[Oracle.DataAccess.Types.OracleTypeException]: numeric precision specifier is out of range (1 to 38).
Looking up this error, I've found that it normally occurs as a result of an attempt to run some DDL SQL that creates a table with a numeric column whose precision exceeds the maximum allowable e.g. numeric(39). This is not the case here, as the stored procedures that are failing are mostly pure select statements and do not even utilise temporary tables or bulk collection. It is almost as if the OracleDataAdapter is unable to get the schema representation of the column when there is not at least one row of data.
I have pasted the full exception stack below:
at Oracle.DataAccess.Types.OracleDecimal.ConvertToPrecScale(OracleDecimal value1, Int32 precision, Int32 scale)
at Oracle.DataAccess.Client.OracleParameter.PreBind_Decimal()
at Oracle.DataAccess.Client.OracleParameter.PreBind(OracleConnection conn, IntPtr errCtx, Int32 arraySize)
at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
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)
Any help on this would be appreciated.
Regards
Roy Griffiths.