Hi Jeff,

I found this topic on the [EMAIL PROTECTED] mailing list.  I am having
the same kind of problem, getting this error for no apparent reason:

<snip>
SQL ERROR: Mismatched parentheses in WHERE clause!

SV = PVIV(0x8538dd8) at 0x8495338
  REFCNT = 1
  FLAGS = (PADBUSY,PADMY,ROK)
  IV = 0
  RV = 0x85575d4
DBD::CSV::st execute failed: dbih_getcom handle
DBD::CSV::Statement=HASH(0x85575d4) is not a DBI handle (has no magic)
at /usr/lib/perl5/site_perl/5.8.0/SQL/Statement.pm line 164.
cannot execute select : dbih_getcom handle
DBD::CSV::Statement=HASH(0x85575d4) is not a DBI handle (has no magic)
at /usr/lib/perl5/site_perl/5.8.0/SQL/Statement.pm line 164.
</snip>

My code reads:
<code>
   my $sth = $dbh->prepare("select distinct user_name from log where
stop_date >= '2003/02/01'");
   $sth->execute() or die "cannot execute select : " . $sth->errstr();
</code>

It worked 100% until I made some addition that I removed again ...
strange.

You mentioned in the list-followup that you will be looking into this. 
Has there been any progress in this regard?  Any way to bypass the
error?

If it is relevant, I am accessing a csv file with DBI and not a normal
database.

Regards,
Rehan van der Merwe
Neil Harvey & Associates
Cape Town


Walter B. Takens wrote:

> Dear all
>
> i am having a problem with SQL-Statement-1.005, whereas 
> SQL-Statement-0.1020 is working fine.
>
> SELECT KOLOM1,KOLOM8,KOLOM5,KOLOM6,KOLOM7 FROM MYTABLE
> WHERE ( (  ( ( KOLOM4 = '123456' OR KOLOM4 = '' ) AND KOLOM3 = '127' ) 
> OR KOLOM8 = 'TRUE' ) AND KOLOM1 = 'bla' ) 

Yes, sorry, there are two bugs in SQL::Statement that are biting you 
there, I am working on both.  The first is the = '' construction -- the 
parser gets confused by that.  The second is the unecessary (but quite 
valid) enclosing of the WHERE clause in outer parens.  Sorry, there is 
no quick fix, I'll try for a new release as soon as I can.

-- 
Jeff

Reply via email to