Delphi: How to get the query that is passed to the server when parameters are used

血红的双手。 提交于 2019-11-30 21:59:24

The actual SQL statement of a parameterized query which is sent to the server never contains textual representation of the parameter values. Instead, it uses placeholder characters, e.g. question marks. In your example, this would be select * from customers where customer = ? This is prepared on the server and parameter values are then sent by the client in a separate call.

If you're using Devart components then they have a TMSSQLMonitor component which may help. If you're connecting via odbc you can monitor the sql by turning on tracing on the odbc tab.

If you're using some other combination please describe.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!