Subject Re: [Firebird-Java] Re: delete with null not executed
Author Roman Rokytskyy
>> so instead of doing
>> delete ... where x=?
>> i now do
>> delete ... where x=? or (?=0 and x is null)
>
> this works but unfortunately it changes the execution plan for a query
> with a where clause of 1 column (the primary key)

Yup. Therefore try instead "x=?" another form, which is "x IS NOT
DISTINCT FROM ?". This is longer to write, but does exactly what you
need. Works however only in 2.0+.

Issue is that NULL=NULL -> false and this is according to the SQL standard.

Roman