Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 8 Jahren, 11 Monaten
Letzter Beitrag:
vor 8 Jahren, 10 Monaten
Beteiligte Autoren:
Peter H., Arie, issah, Peter Holemans.pcs.crosspost

Get SQL statement sent to server

Startbeitrag von Peter Holemans.pcs.crosspost am 20.08.2009 11:44


I'm using SQL Server with OLEDB and use queries created with the query editor (SQL code directly entered with parameters between curly brackets).

I first assign all the query parameters (the ones I don't need with null to exclude them) and then execute the query using hExecuteQuery with a specific OLEDB connection.

Is there a way to retrieve the SQL statement (log, trace, ...) in code as it is sent to the server by the WX runtime? The ..SQL attribute of the data source only provides the bases SQL statement, not the SQL statement as it is sent to the OLEDB provider.

Any clues?


Peter H.

Message forwarded from pcsoft.us.windev


Normally, I am worried about the exact SQL statement when I am not getting the desired output or getting an error. If that is the case, then

if erroroccurred() then

will do the trick.



von issah - am 20.08.2009 18:27
Hi Issah,

Thanks... I'm using this already since I always implement an automated logging system to capture undesired runtime errors. This will provide indeed the perfect and complete SQL statement as it has been sent to the server.

In this case however, I'm interested in capturing the SQL statement also when everything goes well...

I would find it extremely weird that you can only capture the SQL statement when it fails.

Anybody else?


Peter H.

von Peter H. - am 20.08.2009 19:19
From WD I don't know,
But you can use the "profiler" on the mssql-side. It gives you about everyhting you want to know. I'm using is every now and then to get, indeed, the sql-statement!


von Arie - am 20.08.2009 19:44
I've send a suggestion to PCSoft Tech Support. They forwarded it to their Dev team. Something for V15?



von Peter H. - am 27.08.2009 10:41
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.