How to get the sql with parameters replaced?

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
josimarz
Junior Boarder
Junior Boarder
Posts: 41
Joined: 14.09.2009, 17:29
Location: Brazil

How to get the sql with parameters replaced?

Post by josimarz »

Hello!

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

Josimar
jeremicm
Senior Boarder
Senior Boarder
Posts: 61
Joined: 18.10.2006, 17:07
Contact:

Post 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....
josimarz
Junior Boarder
Junior Boarder
Posts: 41
Joined: 14.09.2009, 17:29
Location: Brazil

Post 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
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
josimarz
Junior Boarder
Junior Boarder
Posts: 41
Joined: 14.09.2009, 17:29
Location: Brazil

Post 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
Post Reply