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     Inner Query in WebFocus ??

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Inner Query in WebFocus ??
 Login/Join
 
Platinum Member
posted
TABLE FILE B_SQL_COMPANY
PRINT
COMPANYID
ON TABLE HOLD AS HLD1
END


TABLE FILE B_SQL_PROJECTS
PRINT *
WHERE COMPANYID IN (HLD1)END
-EXIT

is there any way to write the inner query in webfocus ??

tks/sam


WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
 
Posts: 133 | Registered: May 12, 2007Report This Post
Virtuoso
posted Hide Post
Sam

What you did is almost the way to do this, there are however some limitations in the size of the hold file.

Change your line "ON TABLE HOLD AS HLD1" to
"ON TABLE SAVE AS HLD1" or "ON TABLE HOLD AS HLD1 FORMAT ALPHA"
And after that first END ad the line -RUN.

In your first TABLE you should add some WHERE statements, otherways a inner join would be a better solution.

If both database tables are in the same format (SQL) you also can write your selection on the server within SQL and do the reporting on that view.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Platinum Member
posted Hide Post
Thanks...

don't have scope for writing sqls... Sweating


WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
 
Posts: 133 | Registered: May 12, 2007Report This Post
Virtuoso
posted Hide Post
Your code is a good way to do this subject to limitations Frank mentions. As for using an inner join, let me first clarify your question. You want records from PROJECTS where company id is in COMPANY, right?

The following would do it:

SET ALL=OFF (This is the default, but doesn't hurt to add it)
JOIN CLEAR *
JOIN COMPANYID IN B_SQL_PROJECTS TO COMPANYID IN B_SQL_COMPANY AS J1

TABLE FILE B_SQL_PROJECTS
PRINT
B_SQL_PROJECTS.COMPANYID
B_SQL_PROJECTS.projectid
B_SQL_PROJECTS.fieldn
B_SQL_COMPANY.COMPANYID NOPRINT
END

The reference to the company id field in COMPANY activates the join. The join with set all=on means only display records where all segments are satisfied (i.e. you actually found a matching companyid record in the cross-referenced file). Thus you only get records from PROJECTS where the companyid also exists in COMPANY.

The actual syntax for the join will differ somewhat if you're using a recent version of the GUI tool. Something more like

JOIN
INNER B_SQL_PROJECTS.COMPANYID IN B_SQL_PROJECTS TO UNIQUE B_SQL_COMPANY.COMPANYID IN B_SQL_COMPANY AS J0
END

subsequent correction of syntax per Ginny's later post

This message has been edited. Last edited by: Darin Lee,


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
quote:
SET ALL=ON (This is the default, but doesn't hurt to add it)


Just to clarify, OFF is the default for SET ALL.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
my mistake - Ginny is correct. OFF is the default and SET ALL=OFF is what you want to use.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 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     Inner Query in WebFocus ??

Copyright © 1996-2020 Information Builders