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] SQL passthru with sub selects

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] SQL passthru with sub selects
 Login/Join
 
Gold member
posted
Hi,

This Works-
SQL
SELECT CAR,MODEL FROM CAR ;
TABLE FILE SQLOUT
PRINT *
END

This DOES NOT!
SELECT CAR,MODEL
FROM
( SELECT * FROM CAR )
;
TABLE FILE SQLOUT
PRINT *
END

it gives me this error message
(FOC012) THE WORD 'FILE' OR THE FILENAME APPEARS TWICE
BYPASSING TO END OF COMMAND
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HOLD10

Thanks for your help and suggestions.

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


WF 7.1.1, WF Developer studio 7.1.1, Windows & Mainframe, HTML
 
Posts: 84 | Registered: July 28, 2009Report This Post
Guru
posted Hide Post
The first is correct syntax for SQL Translation.
The second is partial syntax for SQL Passthrough. They are not the same. The SQL Passthrough needs the information statements on the RDBMS database you are connecting to, which you don't supply. Just as well -- the CAR file is FOCUS, not RDBMS anyway.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Gold member
posted Hide Post
So, I would have to save the output from the first SQL statement(inner query) to a hold file and then perform another SQL (outer query) against the hold file?

thanks!


WF 7.1.1, WF Developer studio 7.1.1, Windows & Mainframe, HTML
 
Posts: 84 | Registered: July 28, 2009Report This Post
Guru
posted Hide Post
If you were really doing SQL Passthrough to an RDBMS, you can use a subselect. Not in SQL Translation.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Platinum Member
posted Hide Post
In our trials, this techinque of coding faux SQL pass-through statements against non-RDMBS data sources has very limited functionality. Forget going as far as sub-selects, it does not support most of the basic native SQL functions either.

However when using "SQL DB2" or "SQL SQLMSS" against a real RDBMS, the query can be as complex as anywhere else.

Sandeep Mamidenna


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
I am not connecting to any RDBMS(not using SQL passthru).

How can I capture the output from a simple SQL translator to a hold file so that i can create a report using that hold file. Is that possible?

SQL
SELECT COUNTRY,CAR FROM CAR ;
END


WF 7.1.1, WF Developer studio 7.1.1, Windows & Mainframe, HTML
 
Posts: 84 | Registered: July 28, 2009Report This Post
Expert
posted Hide Post
SQL
SELECT CAR,MODEL
FROM
( SELECT * FROM CAR )
;
TABLE ON TABLE HOLD AS H001
END

TABLE FILE H001
PRINT *
END

works without any errors.

The "TABLE FILE SQLOUT" syntax may be reserved for DBMS SQL only


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
Gold member
posted Hide Post
Hi Francis.

I had the exact same thing at my end and it wasn't working this morning.So, I thought something was wrong.Hmm.

It works now.Thanks!!


WF 7.1.1, WF Developer studio 7.1.1, Windows & Mainframe, HTML
 
Posts: 84 | Registered: July 28, 2009Report This Post
Guru
posted Hide Post
It works even without the HOLD

SQL
SELECT CAR, MODEL
FROM 
(SELECT * FROM CAR WHERE COUNTRY = 'ENGLAND')
;
ON TABLE PCHOLD FORMAT HTML
END


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Virtuoso
posted Hide Post
Simply,

  
SQL
SELECT SSALES, COUNTRY
FROM
(SELECT SUM(SALES) SSALES, COUNTRY, CAR FROM CAR WHERE SALES > 0 GROUP BY COUNTRY, CAR)
;
GROUP BY SSALES DESC
END


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
  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] SQL passthru with sub selects

Copyright © 1996-2020 Information Builders