"Sterin, Ilya" wrote:
>
> > -----Original Message-----
> > From: Sam Roberts [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, November 22, 2001 1:14 PM
> > To: Jeff Zucker; DBI Users
> > Subject: DBD::CSV, having trouble selecting "WHERE a_field = '0'"
> >
> > When I do:
> >
> > select * from my_table where datasize = '0'
You could loose the quotes on the 0, or not, shouldn't matter in this
particular case. If the other entries in the column are numbers, it
probably makes more sense not to put the quotes around the 0.
> > I get nothing, it doesn't match. Weird.
>
> This is probably due to SQL::Statement making a wrong assumption about the
> data type and comparing with == instead of eq.
No, that wouldn't matter in this case.
> $op = ( $val1 =~ $numexp && $val2 =~ $numexp )
The problem is the line above that one:
if ($val1 and $val2 and $op !~ /^IS/i ) {
should be:
if (defined $val1 and defined $val2 and $op !~ /^IS/i ) {
Grrr. Dumb mistake. Fixed now.
Sam is using a bleeding edge version of SQL::Statement, this problem and
fix will not impact anyone using the CPAN version. (Sam, change line 929
in SQL::Statement as shown above, sorry and thanks for spotting it).
--
Jeff