in reply to Quoting problem in DBI:ODBC

Just personal preference, but you might like it. IMHO it makes it easier to read the SQL - try formatting the DBI SQL like this:
$query = q{ SELECT field1, field2, name FROM collection_information WHERE CLIENT = ? }; $sth = dbh->prepare($query) || die "prepare failed: $DBI::errstr\n"; $sth->execute($alias) || die "execute failed: $DBI::errstr\n";
And, most(?) DBD:: modules support table aliasing, like this:
$query = q{ SELECT c.name, c.state, c.zip, FROM collection_information c WHERE c.CLIENT = ? }
which makes it so that you don't have to type the long table name in front of each field. In fact, when you're selecting from just one table, you don't need to use the table name at all in front of each field being selected.

HTH.

Replies are listed 'Best First'.
Re: Re: Quoting problem in DBI:ODBC
by Grygonos (Chaplain) on Jun 28, 2003 at 03:51 UTC
    I prefer doing the sql that way too... didn't know that I could use q{} to accomplish it thanks.
    Thanks for the table aliasing tip I didn't know about that
    As for putting the table names in front of things, I don't like to, but I think Access bombed the last time I tried to leave them out. I'll give it a shot when I'm @ work on monday. Thanks !