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.
In using sql pass through, we are joining two home grown views that return 0 rows in WebFocus. The query return the correct number of rows when executed in the database, but 0 rows in WebFocus. The combined query is:
select * from demographic, majors where demographic.pidm in (11111, 22222, 33333) and our_view.our_term_code('201010') = '0' and demographic.pidm = majors.pidm ; END
Now we can run:
select * from demographic where demographic.pidm in (11111, 222222, 33333) ; END
and we can run:
select * from majors where majors.pidm in (11111, 222222, 333333) and our_view.our_term_code('201010') = '0' ; END
and these return data, but joining them together in WebFocus returns 0 rows.
What is the part that I am missing as to why this join is not possible??
Thanks for your input.This message has been edited. Last edited by: Kerry,
This may or may not be related but .. what does "our_view" refer to in your query? Is that an actual VIEW or maybe a stored procedure? It certainly does not look like a view since it is not listed in your FROM clause but the name is certainly misleading.
Anyway, could you provide us with some more details as to what database you're going against and how are OUR_VIEW and MAJORS physically related?
The way your code is written, your files are all named SQLOUT. You are writting over the file with your next query. Also, your files need to be sorted by the common field. Try: select * from demographic, majors where demographic.pidm in (11111, 22222, 33333) and our_view.our_term_code('201010') = '0' and demographic.pidm = majors.pidm ; TABLE ON TABLE HOLD AS FILE1 END
Now we can run:
select * from demographic where demographic.pidm in (11111, 222222, 33333) ; TABLE ON TABLE HOLD AS FILE2 END
and we can run:
select * from majors where majors.pidm in (11111, 222222, 333333) and our_view.our_term_code('201010') = '0' ; TABLE ON TABLE HOLD AS FILE3 END
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007
select * from demographic, majors where demographic.pidm in (11111, 22222, 33333) and our_view.our_term_code('201010') = '0' and demographic.pidm = majors.pidm ;
As njsden specifies, the SQL looks a bit wrong, you mention the two tables demographic and majors, but the selection criteria is on our_view.
This is most likely not a WebFOCUS problem. Did you test that SQl in a SQL client before inserting it into WebFOCUS?
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
select * from demographic where demographic.pidm in (11111, 222222, 33333) ; END
and
select * from majors where majors.pidm in (11111, 222222, 333333) and our_view.our_term_code('201010') = '0' ; END
work in both SQLplus and in WebFocus. They both pull back the correct rows. The issue is when I join these queries together into this query:
select * from demographic, majors where demographic.pidm in (11111, 22222, 33333) and our_view.our_term_code('201010') = '0' and demographic.pidm = majors.pidm ;
the query works in SQLplus on the datebase but returns 0 rows in WebFocus.
I should also say that both of these are home grown views. I am wondering if we have this issue because they are both views?
Also in the query:
select * from demographic, majors where demographic.pidm in (11111, 22222, 33333) and our_view.our_term_code('201010') = '0' and demographic.pidm = majors.pidm ;
the line:
and our_view.our_term_code('201010') = '0'
is our way of using a package variable to pass a value to a sub-query that is part of the majors view.
I've never seen code that uses package variables, so I can't help you debug this, but you could try creating an Oracle Stored Procedure containing your SQL and then call the Stored Procedure Using SQL Passthru.
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