Subject Re: problem: PreparedStatement with "? IS NULL"
Author bullitenergy
Hello Roman!

Maybe my code is a little bit strange. I tried to do the same as some
VS.NET generated code, but ADO.NET uses named parameters.

WHERE column = :value OR (column IS NULL AND :value IS NULL)

with one parameter assignment makes more sense than

WHERE column = ? OR (column IS NULL AND ? IS NULL)

because there are 2 parameters to assign with the same value.
I found out that i can workaround by using:

WHERE column = ? OR (column IS NULL AND ? = 0)

and instead of using a setNull for the second parameter, i use a
setInt that is 0 on a null value and 1 on something else.

Thank you for your reply and all your Jaybird work!
Best regards,
Bullet Energy