Focal Point
[SOLVED] Where Clause

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

October 06, 2008, 03:57 PM
Noel
[SOLVED] Where Clause
I have two files File A with 570 records and file B with morethan a 1000 records. In file B I have inactive records and I want to exclude them from the list. I did a left outer join from A to B and I have a where statement filtering the active records only in file B. My result is behaving like I did an inner join. Is there other way to make this work with out creating another hold file?
Here is my Code
JOIN
INNER C6AENB AND C6DCCD AND C6CVNB IN N06
TO UNIQUE SROCON AND SRDCCD
AND SRORD# IN WCSRLP00 AS J37
END
TABLE FILE N06
PRINT
'C6AENB'
'C6DCCD'
'C6CVNB'
'SRSRL#'
'SRLBNO'
WHERE WCSRLP00.WCSRLP00.SRATIV EQ 'A';
ON TABLE PCHOLD FORMAT HTML
END

This message has been edited. Last edited by: Kerry,


WebFocus 762 AS400 / DB2
October 06, 2008, 04:11 PM
Francis Mariani
This type of JOIN is new to an old 5.3 coder like me.

Did you turn SQL traces on to see what is passed to SQL? You specify INNER but you're expecting a left outer join?


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
October 06, 2008, 04:18 PM
Noel
Hi Francis,
I'm sorry I paste the wrong code. Here is my code that i'm having problem.
JOIN
LEFT_OUTER C6AENB AND C6DCCD AND C6CVNB IN N06
TO UNIQUE SROCON AND SRDCCD
AND SRORD# IN WCSRLP00 AS J37
END
TABLE FILE N06
PRINT
'C6AENB'
'C6DCCD'
'C6CVNB'
'SRSRL#'
'SRLBNO'
WHERE WCSRLP00.WCSRLP00.SRATIV EQ 'A';
ON TABLE PCHOLD FORMAT HTML
END


WebFocus 762 AS400 / DB2
October 06, 2008, 04:21 PM
GinnyJakes
I might be crazy Noel, but it looks like you coded an inner join.

To do an outer, it should specify that in the join and there should be a SET ALL=ON prior.

Here is an interesting post on the status of joins in WebFOCUS that you might find useful.

https://forums.informationbuilders.com/eve/forums/a/tpc/...561030103#6561030103


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
October 06, 2008, 05:14 PM
RSquared
Noel,

I am confused. How can you have an outer join when you only select where a value on the second table has a value? Once you test the second table for a value, you get an inner join. Perhaps you can change your code to
'- WHERE WCSRLP00.WCSRLP00.SRATIV EQ 'A' OR
WCSRLP00.WCSRLP00.SRATIV IS MISSING;


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit