 Perl: the Markov chain saw  dbi & placeholders: getting the
actual sql  by nop (Hermit) on Sep 12, 2001 at 01:39 UTC
( #111811=perlquestion: print w/ replies, xml ) Need Help??  I
have DBI code like this: my $adsref =
$dbh_g->selectcol_arrayref($sql, undef, @bindvals); where the
sql has a slew of placeholders.  I'd like get my hands on the
actual sql that DBI plunks against the database... do I have to
build the string with a regexp or can I get it from DBI?   1.
regexp What's an efficient way to replace all the "?"
placeholders in my sql with the corresponding elements from the
bindvals? I'd prefer the quoting to be right, too.   2. DBI
...or is there just a way to ask DBI for the actual sql on the
last statement handle? Laziness as a Virtue. Thanks for any
help.  Comment on dbi & placeholders: getting the actual sql
Download Code Re: dbi & placeholders: getting the actual sql by
runrig (Abbot) on Sep 12, 2001 at 01:53 UTC     Depending on the
database, the sql may get passed along as is, with all '?'s inta