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]How to create a temp file to be used as filter in SQL Where Clause?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved]How to create a temp file to be used as filter in SQL Where Clause?
 Login/Join
 
Gold member
posted
How to create a temp file to be used as filter in SQL Where Clause?
In example bellow, I will retrieve the latest 5 dates from database table. Save it as a temp file. The Temp file will be used as a filter in next SQL WHRER clause, to print out employee whose ‘hiredate’ are in the first retrieved temp file.
Where EMPDATA.EMPDATA.HIREDATE IN the-temp-file.
I don’t know what format the save file should be, so it can be used as the input list ( or file) for the Where Clause. Also I got error when use SQL command‘ Where …. IN’ while read from a list or file. Thanks for your help in advance.

 
TABLE FILE EMPDATA
BY  HIGHEST EMPDATA.EMPDATA.HIREDATE
WHERE RECORDLIMIT EQ 5
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE SAVE AS 'LAST_5_DATES' FORMAT XML
END


TABLE FILE EMPDATA
PRINT 
     EMPDATA.EMPDATA.DIV
     EMPDATA.EMPDATA.LASTNAME
     EMPDATA.EMPDATA.FIRSTNAME
WHERE   EMPDATA.EMPDATA.HIREDATE IN  'LAST_5_DATES' ;
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




 

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


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel
 
Posts: 61 | Registered: March 12, 2008Report This Post
Expert
posted Hide Post
FORMAT ALPHA and WHERE IN FILE:

TABLE FILE EMPDATA
BY  HIGHEST HIREDATE
WHERE RECORDLIMIT EQ 5
ON TABLE SAVE AS LAST_5_DATES FORMAT ALPHA
END


TABLE FILE EMPDATA
PRINT 
DIV
LASTNAME
FIRSTNAME
WHERE HIREDATE IN FILE LAST_5_DATES ;
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


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,

Thansk you very much. It works.
The UserForum is such as great community, with so many experts offering help in short time.

thanks again.


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel
 
Posts: 61 | Registered: March 12, 2008Report 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]How to create a temp file to be used as filter in SQL Where Clause?

Copyright © 1996-2020 Information Builders