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] LEFT_OUTER JOIN and missing data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] LEFT_OUTER JOIN and missing data
 Login/Join
 
Expert
posted
I am attempting a left outer join in DB2 to a table that may have missing data. I need to filter on the missing data.

When I have the following code, the LEFT_OUTER command is ignored - an inner join is generated in the SQL:

...
JOIN
LEFT_OUTER PERS_GUAR_D.RRA_SK IN CODED_CRED_HIST TO ALL
PERS_GUAR_D.RRA_SK IN PERS_GUAR_D AS J10
END
...
WHERE
  PERS_GUAR_D.PERS_GUAR_TYP_CD EQ '1' OR
  PERS_GUAR_D.PERS_GUAR_TYP_CD IS MISSING OR
  PERS_GUAR_D.PERS_GUAR_TYP_CD EQ ''
WHERE
  PERS_GUAR_D.PERS_GUAR_END_DT EQ '9999-12-31' OR
  PERS_GUAR_D.PERS_GUAR_END_DT IS MISSING OR
  PERS_GUAR_D.PERS_GUAR_END_DT EQ ''
...

When I remove the filter the left outer join gets created.

I need the filter but perhaps I'm not coding it correctly for the missing data.

Any ideas?

Thanks,

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


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
Expert
posted Hide Post
Francis,

As soon as you issue a selection on the child table WF very kindly changes the join to inner (as you have found). It's one of the occasions when I will resort to using passthru to force the issue - either that or use match.

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, 2004Report This Post
Expert
posted Hide Post
d@mn!

Thanks for the explanation Tony. No SQL message is generated to alert us to this.

Regards,


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
Expert
posted Hide Post
When I'm deep in thought on how I am getting the data it's one of those things that will catch me out still Frowner

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, 2004Report This Post
Gold member
posted Hide Post
Francis,

If you were looking to do this all in FOCUS, then maybe you should consider doing multiple passes. On the first pass leave out the filter that is causing the Left Outer to not get passed. Filter on the second pass for the missing data and you should get the desired results. Of course a SQL passthru would be more efficient, but this is an alternative.


Eric Woerle
WF 7.6.7 Reportting Server
ETL 7.6.10
Dev Studio 7.6.7
 
Posts: 95 | Registered: July 31, 2007Report This Post
Expert
posted Hide Post
Eric,

Thanks for the suggestion - that's what I plan to do.

Cheers,


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
Virtuoso
posted Hide Post
Francis,

Maybe you can use a clustered master file? Putting your 2 tables in the same master and defining a multiple parent-child relation?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Guru
posted Hide Post
Francis,

I believe that you need to hold the result of the Left_outer join and then run the filter logic on the hold file.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Virtuoso
posted Hide Post
See RE: Left Join problem


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
Apparently this will be feasible in v7.7. Since we just upgraded to 7.6.5 from 5.3.4 it will be a long time before we upgrade again.


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
  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] LEFT_OUTER JOIN and missing data

Copyright © 1996-2020 Information Builders