Page 1 of 1

How to get the sql with parameters replaced?

Posted: 01.07.2011, 13:08
by josimarz
Hello!

The TZQuery/TZReadOnlyQuery provides a method that returns the SQL with the parameter values ​​replaced?

Josimar

Posted: 01.07.2011, 13:21
by jeremicm
Sorry, but i can't understand your question very well, but i think you wan't to see values of parameters instead of :paramname... if so, use ZSQLMonitor component and look at logs component create....

Posted: 01.07.2011, 14:29
by josimarz
Hello!

That's exactly what I want. However, the TZSQLMonitor returns SQL without parameter values ​​substituted. It replaces the parameter name with the symbol "?". Example:

Code: Select all

SELECT
   CD_PERSON,
   NM_PERSON
FROM
   PERSON
WHERE
   NM_PERSON LIKE ?
What I really want to see is the SQL with the parameters replaced by their values​​:

Code: Select all

SELECT
   CD_PERSON,
   NM_PERSON
FROM
   PERSON
WHERE
   NM_PERSON LIKE '%van basten%'
Thanks,

Josimar

Posted: 30.10.2011, 22:52
by mdaems
Hi,

In zeos 7 I introduced a new logging format for prepared statements. Now before execution of a prepared statement with IN parameters the parameter values should be logged as well.

Does this work for you?

Mark

Posted: 31.10.2011, 11:49
by josimarz
Hello!

I'm using the TZSQLMonitor component for implement a SQL debugger to my application. I was wrong in thinking that the component does not replace the query parameters.

I take this opportunity to ask: has provision for release version 7 stable?

As for the topic, consider it solved!

Tanks!

Josimar