in reply to How can I display SQL created by DBI

Using perl -d I've seen my sql query text associated with $DBI::lasth. That might work for you.

When I was following the DBI mailing list, a significant portion of people asking questions like this were trying to use placeholders for field or table names. This is not supported by either DBI or some of its drivers. Placeholders are only sure to work for the values in a sql statement.

Be well.