in reply to Quoting problem in DBI:ODBC
And, most(?) DBD:: modules support table aliasing, 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";
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.$query = q{ SELECT c.name, c.state, c.zip, FROM collection_information c WHERE c.CLIENT = ? }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Quoting problem in DBI:ODBC
by Grygonos (Chaplain) on Jun 28, 2003 at 03:51 UTC |