How can I print the SQL query executed after Perl's DBI fills in the placeholders?

前端 未结 8 659
梦毁少年i
梦毁少年i 2021-02-05 09:36

I\'m using Perl\'s DBI module. I prepare a statement using placeholders, then execute the query.

Is it possible to print out the final query that was executed without ma

8条回答
  •  日久生厌
    2021-02-05 09:53

    Not in general, because DBI doesn't necessarily produce such a query. If your database supports prepared statements and placeholders in its API, DBI will pass them through and let the database do the work, which is one of the reasons to use prepared statements.

提交回复
热议问题