Focal Point
joining db2 file to wf holdfile?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9571091381

August 30, 2006, 03:21 PM
.eric
joining db2 file to wf holdfile?
I'm using SQL to download data from our DB2/AS400 connection and I was wondering if it was at all possible to use either hold or save files as part of those SQL queries. The only reason I ask is because some of our sales history files contain millions of records and this would help filter that amount greatly.


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
August 30, 2006, 04:08 PM
newtofocus
Yes it is possible. Joining a hold file to a big DB2 table is tricky. The way iWay/WebFOCUS works in this situation is it will send as much of the query it can DB2 bring back the data and then do the join in the reporting server. So if you have good filtering criteria that restricts the data to small subset it works great, if not you are in trouble.


WF7.1.4 Prod/Test, MRE, self serve, DM
August 30, 2006, 04:18 PM
.eric
Well my question is how do I go about writing that SQL statement. What I have goes something like:

SQL DB2 PREPARE SQLOUT FOR
SELECT FIELD1, FIELD2, FIELD3
FROM LIBRARY.FILE JOIN HOLD
ON LIBRARY.FILE.FIELD1 = HOLD.KEYFIELD
WHERE LIBRARY.FIELD.FIELD2 = 'CRITERIA';
END

TABLEF FILE SQLOUT
PRINT *
END

And the error it gives me has something to do with not knowing which library HOLD belongs to....


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
August 30, 2006, 05:10 PM
KevinG
Eric,

I am not able to provide a code sample, but we do something like this;

Use the READ command to dynamically build a SQL IN statement from your HOLD file. It involves setting up a counter, looping through your HOLD file using DIALOGUE MANAGER and -READ, and using the resulting IN statement in your WHERE condition rather than trying to JOIN to a file SQL doesn't know about.

Hope this helps,

Kevin


WF 7.6.10 / WIN-AIX
August 30, 2006, 05:14 PM
.eric
Thats not a bad idea, I will give that a try, Thanks.


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat