Re: DBD::CSV and SQL::Statement issues
From: Jeff Zucker (jeff_at_vpservices.com)
Date: 05/14/04
- Next message: Jeff Urlwin: "RE: Instaling DBI 1.42 on Mac OS X Server version 10.2.4 I"
- Previous message: Carl Ringwall: "Equivalent DBI code from ADO"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 14 May 2004 07:16:26 -0700 To: Christopher Huhn <C.Huhn@gsi.de>, dbi-users <dbi-users@perl.org>
Hi Chrisopher,
Christopher Huhn wrote:
> I'm missing the following features using DBD::CSV:
>
> * Selecting constant values isn't working (i.e. SELECT 'xyz' FROM
> table). AFAIK that's plain SQL.
Yes, it's plain SQL but not yet supported by SQL::Statement. The syntax
that is supported is listed in the SQL::Parser docs. I plan to revamp
the entire SELECT columns parsing to allow column aliases, functions,
constants, etc. but currently those aren't supported in the
select_columns clause even if they are supported in the WHERE clause.
> * There's no case insensitive IN operator (Yes, I know about CLIKE ...)
Sorry, that's not something I'll probably ever add, but this should work
now: ... WHERE UPPER(foo) IN( UPPER(bar), UPPER(baz) ).
> $sql = 'SELECT wb,from_address FROM whitelist WHERE user_id = ? '.
> 'AND from_address IN (?,?,?)';
> $sth = $dbh->prepare($sql) or die "Cannot prepare: " .
> $dbh->errstr();
> $sth->bind_param(1, '1001');
> $sth->bind_param(2, 'email1@other-domain.tld');
> $sth->bind_param(3, 'email2@third-domain.tld');
> $sth->bind_param(4, 'email3@domain4.tld');
> $sth->execute() or die "Cannot execute: " . $sth->errstr();
> DBI::dump_results($sth);
>
> leads to
>
> Use of uninitialized value in substitution iterator at
> /usr/share/perl5/SQL/Parser.pm line 974.
> SQL ERROR: Bad predicate: ''!
> ii libsql-statement-perl 1.005-1 SQL parsing
There was a bug in the IN parsing in 1.005, sorry. The current version
of SQL::Statement 1.09, works fine with that syntax.
-- Jeff
- Next message: Jeff Urlwin: "RE: Instaling DBI 1.42 on Mac OS X Server version 10.2.4 I"
- Previous message: Carl Ringwall: "Equivalent DBI code from ADO"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|