This is probably due to SQL::Statement making a wrong assumption about the
data type and comparing with == instead of eq. Jeff, are you here? I
looked through the code, but that's the best assumption I could come up
with.
$op = ( $val1 =~ $numexp && $val2 =~ $numexp )
? $s2pops->{$op}->{'n'}
: $s2pops->{$op}->{'s'};
Wonder with one is thought numeric and one string? I'll test a little
later, but if you know a quick answer maybe you can help.
In the mean time you can probably fix it by doing datasize = 0
Ilya
> -----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'"
>
>
>
> I don't know if its a lack of understanding about SQL, or of
> SQL::Statement/
> DBD::CSV, but I have a numeric field "datasize", if I do
>
> select * from my_table
>
> I get
>
> a,0
> b,0
> c,0
>
> When I do:
>
> select * from my_table where datasize = '0'
>
> I get nothing, it doesn't match. Weird. But if I do:
>
> select * from my_table where datasize LIKE '%0%'
>
> I do get matches. I'm baffled. I tried datasize = ' 0' and
> datasize = '0 ' and other variants. I just doesn't match without LIKE.
>
> Suggestions? What's wrong? I'm hacking around it by change = to LIKE,
> but this is strange.
>
> Thanks!
>
> Sam
>
> --
> Sam Roberts <[EMAIL PROTECTED]>