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] Merge multiple tables

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Merge multiple tables
 Login/Join
 
<Kev>
posted
Please pardon me if this question has been raised earlier.
I want to merge three tables together and put it in a hold file, but for some reason following the standard syntax is not helping. Can someone identify what's wrong with what I'm doing?

TABLE FILE TABLE1
MORE
FILE TABLE2
MORE
FILE TABLE3
END

I expect TABLE1 to have merged rows of the TABLE1, TABLE2, TABLE3 in that order, but it keeps rows of only TABLE1.

Thanks in advance!
----------------------------------------------

This message has been edited. Last edited by: Kerry,
 
Report This Post
Expert
posted Hide Post
There are a number of rules to follow to use MORE or Universal Concatenation.

The first thing I noticed is that you don't have a PRINT or SUM statement for your first table.

The second thing is that all of the column names to be printed in all 3 of the masters have to be the same.

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


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
Please read the manual on the basics of the TABLE and MORE commands. You don't have a display command or any columns specified.

Your syntax should look something like this:

TABLE FILE TABLE1
PRINT|LIST|SUM|COUNT (one of these)
column1
column2
column3
...
[ON TABLE HOLD AS H001]

MORE
FILE TABLE2
MORE
FILE TABLE3
END


The columns have to be available in all the tables and they must have the same format.


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
<Kev>
posted
Hi Ginny,

I've modified the syntax as follows, but with same results. What am I missing here?

TABLE FILE TABLE1
PRINT COL1 COL2 COL3
WHERE COL3 LT 4
MORE
FILE TABLE2
PRINT COL1 COL2 COL3
MORE
FILE TABLE3
PRINT COL1 COL2 COL3
END


Thanks!
-----------------------------------------------
 
Report This Post
Expert
posted Hide Post
The PRINT display statement cannot be repeated for each file - it must be specified only once.


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
<Kev>
posted
I tried above syntax with other tables, and it's working, so I'm guessing columns may not be compatible in my tables. So,
- If columns are not compatible, does it simply ignore those tables?
- Also, how do I find out which columns are not compatible?

Thanks!

---------------------------------------------
 
Report This Post
Expert
posted Hide Post
Kev,

The columns you're extracting from each of the tables must have the same name and format - if they're not the same name and format, you may define virtual fields to rename/reformat them.

If columns do not correspond you should get warning/error messages.

Take a look at the Master files (.mas) for each table, or run this code for each table:

?FF TABLE1
?FF TABLE2
...
This will display the column names. aliases and formats


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
Gold member
posted Hide Post
Kev,
I would recommend coding it like this with only one print.
TABLE FILE TABLE1
PRINT COL1 COL2 COL3
WHERE COL3 LT 4
MORE
FILE TABLE2
MORE
FILE TABLE3
END  


------------------------------------------
DevStudio 8.2.03
WFS 8.2.03
 
Posts: 86 | Location: Atlanta | Registered: May 10, 2007Report This Post
Guru
posted Hide Post
 
TABLE FILE TABLE1
PRINT COL1 COL2 COL3
WHERE COL3 LT 4
ON TABLE HOLD AS HOLITALL --- add this line
MORE
FILE TABLE2
PRINT COL1 COL2 COL3
MORE
FILE TABLE3
PRINT COL1 COL2 COL3
END
 


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Guru
posted Hide Post
Sorry,

and one PRINT command. I copied the original code.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
<Kev>
posted
I'm all set with this. Thanks for your guidance everyone!
 
Report This Post
Virtuoso
posted Hide Post
Note that selection criteria (WHERE and IF clauses) only apply to the section in which they are coded. If you want to impose
WHERE COL3 LT 4
on all three FILE retrievals you have to repeat it:
TABLE FILE TABLE1
  PRINT COL1 COL2 COL3
  WHERE COL3 LT 4;
  ON TABLE HOLD AS HOLITALL 
MORE
FILE TABLE2
  WHERE COL3 LT 4;
MORE
FILE TABLE3
  WHERE COL3 LT 4;
END

See "Creating Reports ...(7.6.1)", Appendix C.

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 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] Merge multiple tables

Copyright © 1996-2020 Information Builders