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     [SOLVED] using SQL in a procedure, getting a prompt rather than it loading in browser

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] using SQL in a procedure, getting a prompt rather than it loading in browser
 Login/Join
 
Member
posted
I'm trying to use SQL for some reports and am running into a strange hiccup. I am getting a save prompt in my browser rather than my HTML output as usual.

If I run this code I get HTML output in my browser like normal, like I want:

SQL
SELECT BODYTYPE, AVG(MPG), SUM(SALES)
FROM CAR
WHERE RETAIL_COST > 5000 AND BODYTYPE <> 'SEDAN'
GROUP BY BODYTYPE;
TABLE
HEADING
"AVERAGE MPG AND TOTAL SALES PER BODYTYPE"
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END


But if I try something very similar against a SQL table in our database (code below), I get a save prompt in my browser instead of my output. I even put the synonym in the same application folder on my reporting server to see if some setting there was causing the difference. Can't figure out why this is happening.

SQL
SELECT SITEKEY
FROM STYLE_DIMSITES;
TABLE
HEADING
"TEST OUTPUT"
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END

Note: I made a test synonym for one of our tables, that's why it has the funny name STYLE_DIMSITES

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


WebFOCUS 7701
Windows 2008
All Formats

 
Posts: 17 | Registered: August 05, 2010Report This Post
<JJI>
posted
Phil,
AS far as I know you can't use PCHOLD directly after your SQL code like you did (except for Focus files). You need to hold it first and then display it in the format you want from that holdfile.

Your code could look like this
SQL SQLMSS
-*change the engine if you using another DB!
SELECT SITEKEY
FROM REAL_TABLE_NAME;
TABLE
ON TABLE HOLD AS HOLD1 FORMAT XFOCUS
END
-*
TABLE FILE HOLD1
PRINT
   SITEKEY
HEADING
"TEST OUTPUT"
ON TABLE PCHOLD FORMAT HTML 
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE


Hope this works for you.
 
Report This Post
Member
posted Hide Post
Thanks Dirk. This explains why it was working with the car file.
I was hoping I could mash the SQL output directly onto my WebFOCUS styling. Will go the holdfile route.


WebFOCUS 7701
Windows 2008
All Formats

 
Posts: 17 | Registered: August 05, 2010Report This Post
Member
posted Hide Post
worked like a charm. thanks again for the clarification. I'm going to switch several reports over to SQL so that I can work more closely with my data architect on the query structure. this was the last step I needed to get working for that plan.


WebFOCUS 7701
Windows 2008
All Formats

 
Posts: 17 | Registered: August 05, 2010Report This Post
<JJI>
posted
Hi Phil,

I'm glad my small contribution helped you solving your problem.
This is what this forum is all about. Helping each other! Wink
 
Report This Post
Virtuoso
posted Hide Post
You do not have to do a hold file. The following was done using dev studio. It does this using a prepare. Less IO in the end.
ENGINE SQLMSS SET DEFAULT_CONNECTION POLY
SQL SQLMSS PREPARE SQLOUT FOR
SELECT [UserID]
      ,[Sid]
      ,[UserType]
      ,[AuthType]
      ,[UserName]
  FROM [ReportServer].[dbo].[Users]
END
TABLE FILE SQLOUT
PRINT 
     UserID
     Sid
     UserType
     AuthType
     UserName
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
  


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
<JJI>
posted
quote:
You do not have to do a hold file

dhagen,
As far as I know by using the PREPARE statement you also create a holdfile (sqlout)behind the screens, only you don't have to code it explicit.
I have tested this and the IO in both cases is the same!
 
Report 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     [SOLVED] using SQL in a procedure, getting a prompt rather than it loading in browser

Copyright © 1996-2020 Information Builders