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?
- 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.
- 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.
nop