Hi, Instead of using WHERE C = ? / C IS NULL you could use (but only in H2): WHERE C IS ?. The standardized way is actually WHERE C IS NOT DISTINCT FROM ?, but many databases don't support it yet (H2 does support it). See also:
http://h2database.com/html/grammar.html#condition_right_hand_side Regards, Thomas On Mon, Mar 12, 2012 at 6:27 PM, [email protected] <[email protected]> wrote: > > > On Mon, Mar 12, 2012 at 7:17 PM, Mark Addleman <[email protected]> > wrote: >> >> Gotcha. Thanks for the explanation. Looks like I need to bone up on my >> Chris Date :) >> >> One more question: Given the spec, what value is the setNull method in >> PreparedStatement? > > > Never used that one. For queries at least. I did for updates, though. And, > while I may mis-remember it, it seems that setObject allows you to set both > null and non-null values. Having a separate setNull make sense if you cannot > set NULL with setInt, setString, setDate.. I remember such a limitation, > but it may have been just a Hibernate thing. Not sure > > -- > Vasile Rotaru > > -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
