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] Union in webfocus, or Save SQL query to hold file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Union in webfocus, or Save SQL query to hold file
 Login/Join
 
Silver Member
posted
I have a question on how to do a union in Webfocus. I need to union F4211 and F42119 (limited to one SO# or group of SO#'s). I don't know how to do a union in Webfocus language, but I do in SQL. But after I do this union I also need to do a join with F4801, so I really need to save to a hold file. Can you save to a hold file when using SQL? If not, can anyone explain how to do a union without resorting to SQL?

This is what I have so far.

SQL
(Select SDDOCO, SDPQOR,
SDUOPN, SDSOQS, SDQTYT, SDLTTR_CODE, SDNXTR_CODE, SDSHAN,
SDAN8, SDADDJ, SDRORN, SDRCTO_CODE, SDUORG, SDSOQS
FROM F4211
WHERE SDDOCO = &so)
UNION
(Select SDDOCO, SDPQOR,
SDUOPN, SDSOQS, SDQTYT, SDLTTR_CODE, SDNXTR_CODE, SDSHAN,
SDAN8, SDADDJ, SDRORN, SDRCTO_CODE, SDUORG, SDSOQS
FROM F42119
WHERE SDDOCO = &so);

END

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
Platinum Member
posted Hide Post
Hi,

You can use a MATCH FILE with OLD-OR-NEW option in WebFOCUS to get the effect of a Union.
If you want to save the output of the SQL you wrote run a query against SQLOUT file and hold the data to a file...

TABLE FILE SQLOUT
PRINT
*
ON TABLE HOLD AS HLD1 FORMAT ALPHA
END

Then you can do a JOIN on this hld1 file.

thanks
Sashanka


WF 7.7.03/Windows/HTML,PDF,EXL
POC/local Dev Studio 7.7.03 & 7.6.11
 
Posts: 103 | Registered: June 12, 2009Report This Post
Guru
posted Hide Post
Insert the following line after the semicolon:

TABLE ON TABLE HOLD AS HOLDFILENAME


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Virtuoso
posted Hide Post
Since it appears the exact same columns are being extracted from both tables, you can use the MORE command to concatenate extracts from the two tables:

TABLE FILE F4211
 PRINT SDDOCO SDPQOR SDUOPN SDSOQS SDQTYT SDLTTR_CODE SDNXTR_CODE
       SDSHAN SDAN8 SDADDJ SDRORN SDRCTO_CODE SDUORG SDSOQS
 WHERE SDDOCO EQ &so ;
 ON TABLE HOLD
MORE
FILE F42119
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Guru
posted Hide Post
Would this work for you?


TABLE FILE F4211
PRINT
      SDDOCO
      SDPQOR
      SDUOPN
      SDSOQS
      SDQTYT
      SDLTTR_CODE
      SDNXTR_CODE
      SDSHAN
      SDAN8
      SDADDJ
      SDRORN
      SDRCTO_CODE
      SDUORG
      SDSOQS
WHERE SDDOCO EQ &so 
MORE
FILE F42119
MORE
FILE F4801
END  


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Silver Member
posted Hide Post
Thank you very much. The MORE syntax works. But now I need to hold that so I can convert the SDRORN from text to a number to join with F4801.

I try this and get an error only when I add the ON TABLE HOLD.

TABLE FILE F4211
BY SDUOPN BY SDSOQS BY SDQTYT BY SDLTTR_CODE BY SDNXTR_CODE
BY SDSHAN BY SDAN8 BY SDADDJ BY SDRORN BY SDRCTO_CODE
BY SDUORG BY SDSOQS
WHERE SDDOCO EQ 124847
MORE
FILE F42119
WHERE SDDOCO EQ 124847
ON TABLE HOLD AS PART1
END

The error I get is "0 ERROR AT OR NEAR LINE 29 IN PROCEDURE _ADHOCRQFOCEXEC *
(FOC953) INVALID STRUCTURE IN SUBREQUEST: ON
BYPASSING TO END OF COMMAND"


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 42 | Registered: April 29, 2010Report This Post
Guru
posted Hide Post
ON TABLE HOLD must be before the first MORE command.


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report 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] Union in webfocus, or Save SQL query to hold file

Copyright © 1996-2020 Information Builders