in reply to Can not get the same output from $dbh->do and $dbh->prepare

Placeholders do only work for column values. The basic rule is that the database must be able to construct a query plan when it sees the prepared statement with only the placeholders. Statements with placeholders are unlikely to work where a table name or column name is expected.

So your best approach is to interpolate the table name and then do a ->selectall_arrayref. Also, you might want to take a look at the catalog methods in DBI, which tell you about tables and columns in a fashion independent of the database.

Replies are listed 'Best First'.
Re^2: Can not get the same output from $dbh->do and $dbh->prepare
by thanos1983 (Parson) on May 25, 2014 at 02:05 UTC

    To: Corion,

    It starts to make more sense, I was not aware of this detail and where ever I read I could not find this details. I assumed since do and prepare are the same maybe I could apply them the same way. Thank you for your time and effort replying to my question.

    Seeking for Perl wisdom...on the process...not there...yet!