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     [CLOSED] Where clause does not return any data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Where clause does not return any data
 Login/Join
 
Gold member
posted
Hello,

I have the following code in my report:
JOIN
 LEFT_OUTER F0115.ADDRESS_NUMBER IN F0115 TO ALL
 F01151.F01151.ADDRESS_NUMBER IN F01151 
 END
TABLE FILE F0115
PRINT
     'DST.F0115.PHONE_NUMBER_TYPE' AS 'PHONE TYPE'
     'DST.F0115.PHONE_NUMBER' AS 'PHONE NUMBER'
     'DST.F01151.ELECTRONIC_ADDRESS_EAEMAL' AS 'EMAIL ADDRESS'
BY 'F0115.F0115.ADDRESS_NUMBER' AS 'CUSTOMER NUMBER'
WHERE F0115.F0115.ADDRESS_NUMBER IN ('7994731','5956693','6232451','7392422','953215')
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET HTMLCSS ON
END
  


When I run the report, I get the data as expected. Please go to the following URL to view the data I get.

no where clause

If I add the WHERE clause in my code. I don't get any data. I should get all the data where the condition is true.

Here is the code with the where clause:

CODE]

JOIN
LEFT_OUTER F0115.ADDRESS_NUMBER IN F0115 TO ALL
F01151.F01151.ADDRESS_NUMBER IN F01151
END
TABLE FILE F0115
PRINT
'DST.F0115.PHONE_NUMBER_TYPE' AS 'PHONE TYPE'
'DST.F0115.PHONE_NUMBER' AS 'PHONE NUMBER'
'DST.F01151.ELECTRONIC_ADDRESS_EAEMAL' AS 'EMAIL ADDRESS'
BY 'F0115.F0115.ADDRESS_NUMBER' AS 'CUSTOMER NUMBER'
WHERE F0115.F0115.ADDRESS_NUMBER IN ('7994731','5956693','6232451','7392422','953215');
WHERE F01151.F01151.ELECTRONIC_ADDRESS_EAEMAL EQ '';
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET HTMLCSS ON
END
[/CODE]

When I run the report with the WHERE clause I get the following message:

0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0

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


WebFOCUS 7.6.9
Windows 2003
HTML, Plain Text
 
Posts: 96 | Registered: March 15, 2010Report This Post
Virtuoso
posted Hide Post
quote:
I should get all the data where the condition is true.


Well, not necessarily. It all depends on what your JOIN is doing. If there are no records in F01151 matching those in F0115 (interesting naming convention by the way) then due to the OUTER JOIN structure you have, you'd get existing values in F0115 but the corresponding ones in F01151 will be MISSING (null).

F0115                                  F01151
-------------------------------------  -------------------------------------------
ADDRESS_NUMBER  PHONE_NUMBER_TYPE ...  ADDRES_NUMBER  ELECTRONIC_ADDRESS_EAEMAL ...
--------------  ---------------------  -------------  -----------------------------
43              Home                   43             myname@site.com
85              Home                   <null>         <null>
775             Cellular               <null>         <null>
...


So, unless you actually have email addresses equal to '' (which is different to NULL/MISSING) it makes sense that you're not getting any results back.

What exactly are you trying to achieve?
Which database are you reporting against?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
If what you need is perhaps the list of ADDRESS_NUMBER's in F0115 for which a corresponding email addresses has not been created (that is, there is no matching record in F01151) then you could attempt the following filter:

WHERE F01151.F01151.ELECTRONIC_ADDRESS_EAEMAL IS MISSING;


Again, it'd really help to know what exactly you're trying to achieve so we can provide more meaningful ideas.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Hmmm, there could also be a possibility of using SET ALL=PASS but it would not work if your data source is not FOCUS.

I think I saw once a setting such as SET ALL=SQL but I cannot really elaborate as to what it does or if it's even related to the subject but you can check that in either the product's documentation or other posts in this forum.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Gold member
posted Hide Post
Thanks for the quick response.

I am actually trying to pull all the address #s where the email is blank.

I need to list the address #, phone type, phone # with the blank email.

I am using JDE which uses Oracle DB2 (that is where the interesting table names are coming from Smiler.

I am not sure how to accomplish this.

For the same records I get Address#, phone type, phone# and email addresses if I don't user the WHERE clause and that is how I know the address# which don't have the email addresses but if I use the WHERE clause I don't get any records.


WebFOCUS 7.6.9
Windows 2003
HTML, Plain Text
 
Posts: 96 | Registered: March 15, 2010Report This Post
Guru
posted Hide Post
What you need to do is Hold the output of the join and then read in the Hold file and apply the Where clause to it. The way Focus works is that it applies the where clause and will not return any records when the field you are testing is missing (blank).


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Gold member
posted Hide Post
cool. I will test and post the result.

thanks.


WebFOCUS 7.6.9
Windows 2003
HTML, Plain Text
 
Posts: 96 | Registered: March 15, 2010Report This Post
Virtuoso
posted Hide Post
quote:
WHERE F01151.F01151.ELECTRONIC_ADDRESS_EAEMAL IS MISSING;


Did you try this yet?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
You should run your code woth SQL trace turned on and check the SQL being passed to your RDBMS. I suspect the WHERE clause on a column in the foreign/child table is causing the SQL translator to replace the LEFT OUTER join with a standard join. This would produce the results you are seeing. You could try either SET ALL = SQL or, more likely, SET ALL = PASS as njsden suggested. Or, as a last resort, you could do what RSquared suggested and hold the results without the offending WHERE clause and then apply the filter to the HOLD file.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
Thank you. I will try the suggestions today and post the results.


WebFOCUS 7.6.9
Windows 2003
HTML, Plain Text
 
Posts: 96 | Registered: March 15, 2010Report 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     [CLOSED] Where clause does not return any data

Copyright © 1996-2020 Information Builders