DbNull on Array binds
Posted: Tue 22 Nov 2005 10:34
If you use array binds on an Oracle SQL insert statement an object type of System.DBNull in the array generates a core dump (shown below)
Exchanging the DBNull class with an actual null value in the array seems to fix the problem. Can you please confirm that this is the current behaviour, and is the recommended method of representing null data values in array inserts.
If I am correct about this, can I please recommend that classes of type DBNull also be treated as nulls on array binds.
Using C#, VS2003, Oracle 9.2, OracleDirect 3.1.5
Regards
Dale
Stack Trace:
at System.Array.InternalSetValue(Object value, Int32 index1, Int32 index2, Int32 index3)
at CoreLab.Oracle.OracleParameter.a(p& A_0, Boolean A_1, Boolean A_2, OracleCommand A_3, Byte[] A_4, x A_5)
at CoreLab.Oracle.OracleCommand.a(OracleParameterCollection A_0, p[] A_1, bg A_2, x A_3)
at CoreLab.Oracle.OracleCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
at CoreLab.Common.DbCommandBase.b(CommandBehavior A_0)
at CoreLab.Common.DbCommand.ExecuteReader()
at CoreLab.Common.DbCommandBase.ExecuteNonQuery()
at CoreLab.Oracle.OracleCommand.ExecuteArray(Int32 iters)
Exchanging the DBNull class with an actual null value in the array seems to fix the problem. Can you please confirm that this is the current behaviour, and is the recommended method of representing null data values in array inserts.
If I am correct about this, can I please recommend that classes of type DBNull also be treated as nulls on array binds.
Using C#, VS2003, Oracle 9.2, OracleDirect 3.1.5
Regards
Dale
Stack Trace:
at System.Array.InternalSetValue(Object value, Int32 index1, Int32 index2, Int32 index3)
at CoreLab.Oracle.OracleParameter.a(p& A_0, Boolean A_1, Boolean A_2, OracleCommand A_3, Byte[] A_4, x A_5)
at CoreLab.Oracle.OracleCommand.a(OracleParameterCollection A_0, p[] A_1, bg A_2, x A_3)
at CoreLab.Oracle.OracleCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
at CoreLab.Common.DbCommandBase.b(CommandBehavior A_0)
at CoreLab.Common.DbCommand.ExecuteReader()
at CoreLab.Common.DbCommandBase.ExecuteNonQuery()
at CoreLab.Oracle.OracleCommand.ExecuteArray(Int32 iters)