Page 1 of 1

DbNull on Array binds

Posted: Tue 22 Nov 2005 10:34
by dedgar
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)

Posted: Fri 25 Nov 2005 15:52
by Oleg
OraDirect .NET does not fully supports DML array with Object datatype: you cannot use null values.

Posted: Tue 27 Dec 2005 08:47
by achib
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

Alexei

Posted: Fri 30 Dec 2005 14:43
by Paul
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.