in reply to basic dbi question
I don't understand the question. You don't pass any parameters to your query.
You couldn't even if you wanted to. Replaceable parameters only work for values. For identifiers such as table names, you need to use $dbh->quote_identifier.
my $sth = $dbh->prepare(" SELECT cols FROM ".$dbh->quote_identifier($tableName)." WHERE col=constant AND col2=constant "); $sth->execute(); while (my $row = $sth->fetchrow_hashref) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: basic dbi question
by Anonymous Monk on Dec 01, 2010 at 20:44 UTC | |
by wallisds (Beadle) on Dec 01, 2010 at 21:07 UTC | |
by ikegami (Patriarch) on Dec 02, 2010 at 01:04 UTC |