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] Is a subquery possible?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Is a subquery possible?
 Login/Join
 
Silver Member
posted
Is there anything like a subquery in webfocus?

Like

resultset = query ("select * from A")
for(resultset.next())
{
resultset2 = query("select z from B where C="+resultset.getField("X"))
}

Can anything similar be done or does everything have to do done with joins and hold files?

I've been using WF a long time, but half the time I can't get it to do what I need, especially when the CARDEX has to be involved. Because that file is so big it doesn't really make sense (to me) to create a hold file. A subquery is much quicker, but it doesn't seem to be possible in WF.

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


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 42 | Registered: April 29, 2010Report This Post
Master
posted Hide Post
Josh, you can either use SQL Passthru to do this at RDBMS or anyone of these "JOIN" "MATCH" "IN FILE" will do at WebFOCUS level.

Using REPEAT and counter its possible to get the same functionality.
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Virtuoso
posted Hide Post
The conditional JOIN may be the closest WebFOCUS comes to providing subquery-type functionality.

JOIN FILE from_file AT from_field [TAG from_tag] [WITH fieldname]
     TO [ALL|ONE]
     FILE to_file AT to_field [TAG to_tag]
     [AS as_name]
     [WHERE expression1 ;
      WHERE expression2 ;
      ...              ; ]
END

Here's more: Conditional Joins

WebFOCUS also has the WHERE syntax: WHERE [NOT] field IN FILE fileid, but this syntax does require the use a HOLD file, which does have a size limit. Joins with hold files and MATCH FILE logic are the other methods for performing subquery-type of extracts in WebFOCUS. Unfortunately, these methods tend to be inefficient or even impossible with large amounts of data.

Finally, you can use the WebFOCUS SQL pass-thru facility to create SQL statements, including sub-selects, pass the SQL code directly to the DB, and return the answer set to a WebFOCUS hold file for further processing and/or reporting.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report 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] Is a subquery possible?

Copyright © 1996-2020 Information Builders