Null-values to Date columns with ExecuteArray

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
jtb
Posts: 1
Joined: Wed 14 Jun 2006 13:17

Null-values to Date columns with ExecuteArray

Post by jtb » Wed 14 Jun 2006 13:27

I would like to update multiple rows of a table by ExecuteArray. The table contains a column of type "Date". How can I write Null-Values to rows at the date column?
If I create a Date-Array and assign "Nothing" to one array element the minimum Date value gets written to DB. (01.01.0001 12:00AM)
I tried to use an array of CoreLab.Oracle.OracleDate but got a exception saying ~ "this method is not supported" with following stacktrace:

Code: Select all

 bei CoreLab.Oracle.OracleUtils.b(Type A_0)
   bei CoreLab.Oracle.OracleParameter.get_OracleDbType()
   bei CoreLab.Oracle.OracleParameter.a(bf& A_0, Int32 A_1, Int32 A_2, ad A_3)
   bei CoreLab.Oracle.OracleCommand.a(Int32 A_0, OracleParameterCollection A_1, ad A_2, Boolean& A_3)
   bei CoreLab.Oracle.OracleCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
   bei CoreLab.Common.DbCommandBase.c(CommandBehavior A_0)
   bei System.Data.Common.DbCommand.ExecuteReader()
   bei CoreLab.Common.DbCommandBase.ExecuteNonQuery()
   bei CoreLab.Oracle.OracleCommand.ExecuteArray(Int32 iters)
   bei DBHlp.OraDirectWrapper.ExecuteOracleCommandForArray(IDbCommand cmd, Int32 iterations) in C:\_VS.Net\DBHlp\OraDirectWrapper.vb:Zeile 151.
   bei DBHlp.OracleBaseWrapper.UpdateRows(DataTable t, String scheme, String tableName) in C:\_VS.Net\DBHlp\OracleBaseWrapper.vb:Zeile 819.

Guest

wrong constructor overload

Post by Guest » Thu 15 Jun 2006 06:29

Ok. Found my mistake. The parameter was created with wrong OracleDBType because of using wrong constructor overload...
After setting OracleDBType of the Parameter explicitly and using OracleDate as Param array type all does fine.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 15 Jun 2006 06:37

Well done.

Post Reply