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.
I do not think that you can achieve what you want within the master file description using DEFINEs - someone will now prove me wrong. You certainly can not use SQL statements.
You could try
JOIN CLEAR *
JOIN LEFT_OUTER Customer_id IN Sales TAG S TO customer_id IN customer TAG C AS J1.
TABLE FILE Sales
PRINT S.Customer_id
WHERE C.customer_id IS MISSING
END
or you could include the SQL within the focexec itself using SQL passthru, many examples of which exist in the many topics and posts on this forum.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Yes, I know that I can't use SQL in master file definitions. In fact, I've asked about equivalent Focus statement. (I'm novice in Focus)
Thank you for your advice, in fact it's equivalent in SQL to:
SELECT S.Customer_id FROM SALES S LEFT OUTER JOIN customer C ON S.customer_id = S.customer_id WHERE C.customer_id IS NULL
It's equivalent to NOT EXISTS statement, but from my experience NOT EXISTS sometimes works faster then LEFT OUTER JOIN (in MSSQL) I've thought in Focus exists something like antijoin.
(Now I'm looking for something like Oracle antiunion - select from multiple sources only different records)
SQL Passthru - is not possible when sources from different connections.
WF 7.6.2, WinNT/2K, MSSQL 2K, MSOLAP 2K, BID
Posts: 79 | Location: Moscow | Registered: April 27, 2007
There is no way that I know of to write FOCUS code that will translate into SQL code that contains a subquery in a WHERE clause. IBI Tech Support would be the best people to ask about this but I have never seen this in any information I have read about FOCUS to RDBMS efficiencies.
I'm not sure what this will translate to as far as SQL but this is another way to accomplish the same thing. Be careful of the limits on how many values can be in the VALIDVALUES file. The limit with an IF selection is 32,767 according to the WF 7.1 manual. This will create a large SQL request depending on how many values there are in the VALIDVALUES list.
TABLE FILE CAR SUM COUNTRY NOPRINT BY COUNTRY WHERE COUNTRY EQ 'ENGLAND' OR 'W GERMANY' ON TABLE SAVE AS VALIDVALUES END -RUN TABLE FILE CAR PRINT COUNTRY CAR MODEL BODYTYPE IF COUNTRY IS-NOT (VALIDVALUES) END
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
For a 1-1 join, you can define fields based on the values in the virtual (joined-to) segment, and the define will be evaluated whether or not an actual instance is located, as though an instance had been retieved whose fields are all blank or zero.
JOIN COUNTRY IN HOLD TO COUNTRY IN CAR DEFINE FILE HOLD TAKE/I1 = CAR.ORIGIN.COUNTRY EQ ' '; END TABLE FILE HOLD PRINT * IF TAKE IS TRUE END
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
True, it could take a long time depending on the number or rows in each table. However, assuming this is a relational database, having a foreign key relationship between the 2 tables eliminates the need for the query because one could not insert a row the SALES table before the customer was added to the CUSTOMER table.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006