Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Capturing the generated SQL statement

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Capturing the generated SQL statement
 Login/Join
 
Gold member
posted
Hi,
I am trying to see the generated SQL statement from my procedure. Is there any way to see that? I searched on it and found it could be achieved if i insert following code in my procedure.
SET XRETRIEVAL=OFF
SET TRACEUSER=ON
SET TRACEOFF=ALL
SET TRACEON=STMTRACE//CLIENT
SET TRACEON=SQLAGGR//CLIENT
But still i am not able to get the sql. Can somebody guide me how to do this?

Thanks,
Chirag


7.6.11
Linux
Excel, HTML, PDF

 
Posts: 69 | Registered: February 15, 2008Report This Post
Virtuoso
posted Hide Post
This is what I usually use:
  
SET TRACEOFF=ALL
SET TRACEON=SQLAGGR//CLIENT
SET TRACEON=STMTRACE//CLIENT
SET TRACEON=STMTRACE/2/CLIENT
SET TRACEUSER=ON


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
Thanks Daniel, Its working fine when i have a single procedure. But i have some procedures included in the current procedure and if html form is there, the html output is displayed not the sql query.


7.6.11
Linux
Excel, HTML, PDF

 
Posts: 69 | Registered: February 15, 2008Report This Post
Virtuoso
posted Hide Post
Chirag,

Did you try using "view source" on your displayed HTML? You should find the trace there.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
I have got it.
Thanks Daniel!


7.6.11
Linux
Excel, HTML, PDF

 
Posts: 69 | Registered: February 15, 2008Report This Post
Virtuoso
posted Hide Post
Chirag,

What you also can do is to specify a filename to hold the trace output, like:
SET TRACEUSER=c:\temp\tracefile.trc
in stead of
SET TRACEUSER=ON
Be sure to have the extension of the filename set to .trc, otherwise it will not write to the file.

Hope this also helps a bit...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
GamP,

I am interested in your suggestion of saving the SQL trace in a file, but I can't get it to work.

These SQL trace commands create an empty trace file but display the SQL trace in the web browser window:

SET TRACEON=SQLTRANS
SET TRACEON=STMTRACE//CLIENT
SET TRACEON=SQLAGGR//CLIENT
SET TRACESTAMP=OFF
SET TRACEWRAP=78
SET TRACEUSER = D:\ibi\apps\testfm\tracefile.trc
-RUN


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Hi Francis,

Try this:

  
SET TRACEUSER=D:\ibi\apps\testfm\tracefile.trc
SET TRACEUSER=ON
SET TRACEOFF=ALL
SET TRACEON=SQLAGGR/1/FSTRACE
SET TRACEON=STMTRACE/1/FSTRACE


Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Tom,

That works.

It's the FSTRACE parameter of the TRACEON statements that send the trace to the tracefile.

Thanks very much.

Cheers,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Hey Francis,

Glad it worked for you!!

Gerard,

Really enjoyed meeting you at Summit!! Hope all is well across the Atlantic...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
GamP,

Is there a way to capture the trace output into an amper variable? I would like to use it to write to an error/log file along with some other stuff. If not, I can always just -READ it back from the file using your suggestion.

Thank you,

Jesse

This message has been edited. Last edited by: jpblake,




Jesse Blake
WebFOCUS 7.6.x
Windows
 
Posts: 2 | Location: Ogden, UT | Registered: November 09, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Capturing the generated SQL statement

Copyright © 1996-2020 Information Builders