Focal Point
How to find what SQL is generated

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

September 23, 2003, 01:50 PM
<NIVAS>
How to find what SQL is generated
Hi
My question is
What SQL is generated if an Alpha or Date field is SUMmed in a WebFOCUS request?
Please let us know if u guys any idea

I did try this way but i didnt find sql generated when i view source code on html output

SET TRACEUSER = ON
SET TRACEON = STMTRACE//CLIENT
TABLE FILE filename
PRINT field
END

Thanks,
nivas


Thanks,
October 01, 2003, 08:42 PM
jodye
Hi There

This usually works for me. Place this after your request and then view source. Like this...

TABLE FILE filename
PRINT field
END
SET TRACEOFF = ALL
SET TRACEON = SQLAGGR//CLIENT
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON
April 15, 2004, 06:33 PM
jif26
Mmm...this doesn't work for me either. I'm using WF Browser 4.3.6

Just trying to trace

TABLE FILE CAR
PRINT MODEL
END

Never able to see any trace within the 'view source'. Any ideas ?
April 15, 2004, 06:48 PM
Carol Dobson
I get my trace like this; you may need the echo and you may need to add an -EXIT before it produces a report to see the trace. Good Luck!

SET MSG=ON
-SET &ECHO=ALL;
SET TRACEOFF = ALL
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON
-RUN

BTW, Jodye - the think setting the AGGR/CLIENT makes Focus do the work.

Carol
April 15, 2004, 07:08 PM
jif26
quote:
Originally posted by Carol Dobson:
[qb] I get my trace like this; you may need the echo and you may need to add an -EXIT before it produces a report to see the trace. Good Luck!

SET MSG=ON
-SET &ECHO=ALL;
SET TRACEOFF = ALL
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON
-RUN

Carol [/qb]
Tried it...no luck. What do you mean by putting a -EXIT BEFORE the report ? If I do that, the code stops there and of course the report doesn't show. This is ran from the ad hoc window from the server (Focus Request Session). I just execute a fex with this inside, please tell me what's wrong :

SET MSG=ON
-SET &ECHO=ALL;
SET TRACEOFF = ALL
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON
-RUN

TABLE FILE CAR
PRINT MODEL
WHERE COUNTRY EQ 'ENGLAND'
END
-RUN
-EXIT
April 15, 2004, 07:18 PM
Carol Dobson
The CAR file is not a SQL table, so the trace won't work! Remember this is to see a SQL trace.

Here's a real request;

SET MSG=ON
-SET ECHO=ALL;
SET TRACEOFF = ALL
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON
-RUN

TABLE FILE ASTFOC
PRINT PORTFOLIO_A
IF READLIMIT EQ 100
END
-RUN

Then select VIEW, SOURCE
to see the trace; Here's a real trace.

15.12.31 AE SELECT TOP 100 T1."PORTFOLIOSHORTNAME" FROM dbo.MonthEnd T1;
0 NUMBER OF RECORDS IN TABLE= 100 LINES= 100
April 15, 2004, 07:21 PM
jif26
Darn! How stupid of me... Tried it on another table, worked. Thanks!
May 17, 2004, 02:38 PM
koslo
Trying to get this to work on mainframe FOCUS (V7.2). I'm joining an internal HOLD file to a DB2 file and getting incorrect output. Long time ago you could allocate FSTRACE3 and FSTRACE4, but that no longer works. I get nothing when using the methods you've described. Any ideas? Thanks.
May 17, 2004, 05:44 PM
Mikel
koslo:

FSTRACE3 and FSTRACE4 still works for me on 7.1.1, and according to Tracing DB2 Interface Processing documentation, FSTRACEn must work on 7.2.

Regards,
Mikel
May 17, 2004, 07:10 PM
<Kyle>
To make the tracing process quicker, try adding

SET XRETRIEVAL=OFF

to the request. This will generate the same traces as above but it won't actually submit the query to the database; very useful if your request takes a while to run on you don't want to do a "View Source" document.