nop has asked for the wisdom of the Perl Monks concerning the following question:
I have DBI code like this:
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?
nop
where the sql has a slew of placeholders.my $adsref = $dbh_g->selectcol_arrayref($sql, undef, @bindvals);
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.
nop
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: dbi & placeholders: getting the actual sql
by runrig (Abbot) on Sep 12, 2001 at 01:53 UTC | |
(dkubb) Re: (2) dbi & placeholders: getting the actual sql
by Anonymous Monk on Sep 12, 2001 at 06:12 UTC |
Back to
Seekers of Perl Wisdom