in reply to Re: DBI-quote doesn't like tied hashes?
in thread DBI-quote doesn't like tied hashes?

chromatic wrote:
> I prefer to use placeholders: > > my $sth = $dbh->prepare("SELECT * FROM ?");
I also prefer to use placeholders, but only when I can actually use them. :) In the databases I've used, you can't use a placeholder for the table name, because the database driver doesn't have enough information to create an execution plan if it doesn't know the table name.

In general, though, I heartily endorse the use of placeholders. :)

Replies are listed 'Best First'.
RE: RE: Re: DBI-quote doesn't like tied hashes?
by BBQ (Curate) on May 17, 2000 at 01:30 UTC
    Yeah, and in those cases (ie; with table names) I do it both ways...
    $sth = $dbh->prepare(qq{ select $ouch,$this from $hurts where $another = ? }) or DoSomethingElse();
    I know this looks stupid has hell, and it has bothered me in the past too! But, I don't use it that often so I never really bothered looking for a solution. At least keeping the values within the placeholders I get DBI to quote them for me. I haven't had the need to quote a table name yet...