Focal Point
How to Easily Capture Generated SQL

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5201067331

April 02, 2003, 09:40 PM
Jeff Granger
How to Easily Capture Generated SQL
Here is a technique that enables you to easily view, via your browser, the SQL generated by the reporting server when it executes a TABLE FILE request against a relational data source. It only works if the output you are creating is in HTML format.

It does not require changing ibitrace, the server configuration or using the server's web console. It should work for WebFOCUS 4.3.x and 5.2.

NOTE: I haven't tried it via Dev Studio.

Technique
---------
Add the following statements before the TABLE FILE logic you want to investigate:

SET TRACEOFF = ALL
SET TRACEON = SQLAGGR//CLIENT
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON

TABLE FILE table name
PRINT verb object
END

You can see the output from the trace statements by viewing the source code of the web page returned to your browser.

NOTE: This should work for most if not all SET TRACEON options - not just the SQL trace settings specified in the example.

Hope this helps! Smiler
April 14, 2003, 05:49 PM
N.Selph
Great- I didn't know traces could be sent back to the client!
May 07, 2003, 08:38 PM
Carol Dobson
Jeff, this is awesome - a real time saver. I couldn't see the Trace in the "View Trace" but it shows up in the Console in WebFocus 4.3.6 PowerReporter. Thanks for sharing!!!!