DbNull on Array binds

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Posts: 6
Joined: Tue 22 Nov 2005 10:23

DbNull on Array binds

Post by dedgar » 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


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)

Devart Team
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Post by Oleg » Fri 25 Nov 2005 15:52

OraDirect .NET does not fully supports DML array with Object datatype: you cannot use null values.

Posts: 24
Joined: Thu 06 Oct 2005 11:23

Post by achib » Tue 27 Dec 2005 08:47

Hi Oleg!

I ran into the same problem. I use object[] arrays due to System.DbNull values. My object array has Int32 and null values.
What should I do now? I bought your control due to array binding feature (it says in the OraDirect description) and now you say about "not fully supports DML array" :shock:
PS: I use 2.5.3


Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Fri 30 Dec 2005 14:43

Yes, current versions of OraDirect .Net use typed arrays (array of Int32 for this example). So you can use "Int32" and "null" values now. Possibly this will be changed in the next versions to support DbNull.Value too.

Post Reply