Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using NULLs in array binding for DELETE

Mike NJan 15 2021 — edited Jan 20 2021

I am using array binding to delete multiple rows in a table. The query is like

DELETE FROM Table WHERE Column = :Column

where Column is an array. The problem is, when one of the values is null, it is ignored, so the rows with Column being NULL are not deleted. The issue gets much more complicated when several conditions are involved (WHERE Column1 = :Column1 AND Column2 = :Column2...).
Is there a simpler way to do what I want than filtering the list of values for null and creating a bunch of different queries, where the null-comparison is replaced with IS NULL?
In the command I set the ArrayBindCount, but no other special property. This is how the parameter is added:

command.Parameters.Add(parameterName, dataType, value, ParameterDirection.Input);
This post has been answered by Solomon Yakobson on Jan 26 2021
Jump to Answer
Comments
Post Details
Added on Jan 15 2021
9 comments
958 views