[Dbi-dev is for driver maintainers, not for general support questions.
I reposted to dbi-users.]

> -----Original Message-----
> From: Paul G. Weiss [mailto:[EMAIL PROTECTED] 
> Sent: Monday, March 06, 2006 11:47 AM
> To: [email protected]
> Subject: Binding undefs in DBD::Oracle
> 
> I always that the binding undef's in DBD::Oracle was the way to bind a
null, yet:
> 
> 
>    DB<5> x $dbh->selectall_arrayref('select x,b from tbl where a=?',
undef,
> 4)
> 0  ARRAY(0x9b53010)
>     0  ARRAY(0x9ba6284)
>        0  'bbc0dfec7ba578f2dafc8f2eb42fbd3ae17cf300'
>        1  undef
> 
> but
> 
>    DB<3> x $dbh->selectall_arrayref('select x,b from tbl where a=? and
b=?', undef, 4, undef) 0  ARRAY(0x9ba0530)
>       empty array
> 
> i.e. the 'b=?' in the statement where I bind the value to undef does
_not_ act like 'b is null'.
> 
> Didn't this used to work?  I've tried this with DBD::Oracle v1.16 and
1.17.
> 
> -P

No, that won't work.  There is a section dedicated to this in the DBI
manual,
under the heading "NULL Values".

 
http://search.cpan.org/~timb/DBI-1.50/DBI.pm#Placeholders_and_Bind_Value
s

I usually use "(b = ? or (b is null and ? is null))".

Philip

Reply via email to