|
On 21-Oct-2014 17:38 -0500, Hoteltravelfundotcom wrote:
I have gotten the data as I need using CPYF.
Now to make this dynamic, I want to use UNION
Will this be the same as CPYF that is, if all fields are the same
lengths and # of fields are the same, we get the add perfectly.
The SQL is much more sophisticated, plus the column names are immaterial
for the UNION query; the column names from the /primary/ file are used for
the result set if they are not specified explicitly. The allowed /mapping/
and the defined /promotion/ of data types for the SQL determines if the
query is allowed [without explicit casting or other
derivations\expressions] and if so, then also what is the final data type
of each column.
Presuming [based on a prior topic that was posted about] there are two
files with identical column definitions but different column names [e.g.
name prefix betwixt, being the only differences], the UNION query is quite
simple:
select * from first_file
union all
select * from second_file
The CREATE VIEW is a tad more particular with regard to naming the
columns, so a column-list would be required:
create view union_view
( "1stField" for f1
, "2ndField" for f2
, "NthField" for fn
) as
select * from first_file
union all
select * from second_file
--
Regards, Chuck
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.