Consultor Eletrônico



Kbase P87409: What does -Dsrv qt_debug,SQL print in dataserv.lg?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/29/2008
Status: Verified

GOAL:

What does -Dsrv qt_debug,SQL print in dataserv.lg?

GOAL:

I turned on -Dsrv qt_debug,SQL, but the SQL printed in dataserv.lg does not reflect what I sent to DataServer, why?

GOAL:

How can I see real query string passed to SQL server?

FACT(s) (Environment):

MS SQL DataServer
Windows

FIX:

If you turn on -Dsrv qt_debug,SQL, the SQL that gets printed in dataserv.lg does not reflect real query string that gets sent and received by SQL server.

For example

FOR EACH customer WHERE NAME="Off The Wall":

DISPLAY NAME.
END.

Translates into following SQL in dataserv.lg


Execute new: SELECT PROGRESS_RECID, "name" FROM

"demo"."dbo"."customer" WHERE (("name" = ?)) ORDER BY "name", PROGRESS_RECID


The SQL should be


SELECT PROGRESS_RECID, "name" FROM "demo"."dbo"."customer" WHERE (("name" = ?Off The Wall?)) ORDER BY "name", PROGRESS_RECID

This is because the statement logged by qt_debug,sql *is* the statement that gets sent to the ODBC driver. We don't add the actual values in the where clause so we can reuse the statement and bind the values in the where clause to whatever they need to be for each execution. The server receives everything and executes it based on the statement and the values passed. So in that sense, you are not going to get the EXACT statement executed, because we don't build it that way.


-Dsrv qt_debug,34 can be used to see the value passed.

15:21:52 Execute new: SELECT PROGRESS_RECID, "name" FROM "demo"."dbo"."customer" WHERE (("name" = ?)) ORDER BY "name", PROGRESS_RECID


15:21:52 Parameter #1, length=13, type=12

15:21:52 Value: % x"2066664f 20656854 6c6c6157 00000000 "

15:21:52 Value: "Off The Wall."