I have a text file that is a single primary key field.
I want to somehow import this file into my WebFOCUS query to then join to an existing master file or hold file.
I'm hoping to either copy/paste the records in the text file as a single string that becomes the where clause, or use it as some sort of where/join (where ID is in the text file).
Is something like this possible with WebFOCUS, and if so, what keywords should I be searching the IBI documentation for?
Thank you.This message has been edited. Last edited by: ColdWhiteMilk,
Production - 7.6.4 Sandbox - 7.6.4
March 26, 2014, 11:11 AM
Francis Mariani
The file should be located somewhere WebFOCUS can access. Then you FILEDEF it. Then you use it in a WHERE IN FILE statement. In this example, the file is located in one of the application folders:
FILEDEF PRIMARY1 DISK baseapp/primary1.txt
-RUN
TABLE FILE ____
PRINT *
WHERE PRIMARY_KEY_COL IN FILE PRIMARY1
END
-RUN
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
March 31, 2014, 11:19 AM
Ram Prasad E
create a master file, use dataset attribute to refer to the text file and then use it in JOIN.
If the number of records is less than 1000 then it is more efficient against a SQL source to use the syntax suggested by Francis as it will be used within an IN statement in your SQL (depending upon how you code it maybe).
I would definitely NOT use it in a join (parent OR child) whilst it was a flat file.
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
April 03, 2014, 10:35 AM
ColdWhiteMilk
The file will end up with less than 1000 rows. Most likely less than 500 rows.
Production - 7.6.4 Sandbox - 7.6.4
April 07, 2014, 05:28 AM
Ramkumar - Webfous
Make it a CSV or Excel.. Upload it using "Upload File" option in synonym/Master Files folder. Then use it in your code. 500 to 1000 rows, this would work perfectly.
Thanks, Ram.
Thanks,
Ramkumar. WebFOCUS/Tableau Webfocus 8 / 7.7.02 Unix, Windows HTML/PDF/EXCEL/AHTML/XML/HTML5