No regard for column names, but the number of columns and the data types of each column must match for EXCEPT to work.

On 5/1/2012 4:45 PM, CRPence wrote:
On 01 May 2012 16:24, John McKee wrote:
Nice to know, and loads simpler. Maybe this is the way to go.
Still wonder just what the heck I am doing wrong.
I did not even look at the RPG source provided; figured it would move
to the RPG list eventually.

Maybe a dumb question, but with different column names, would SQL
just compare data with no regard to column names?
Works fine; i.e. irrespective of column names.

For example:


create table qtemp/"a.m."
(xamchar char, xamdate date not null with default, xamdeci dec)
create table qtemp/"p.m."
(xpmchar char, xpmdate date , xpmdeci dec)
insert into "a.m." values
; -- Above is the "morning" snapshot of the data
insert into "p.m." (select * from "a.m.")
; -- make an identical copy to add\upd only the "odd" rows
update "p.m." set xpmchar='A' where xpmchar='1'
; -- change first column for row 1
update "p.m." set xpmdate=NULL where xpmchar='3'
; -- change second column for row 3
update "p.m." set xpmdeci=55 where xpmchar='5'
; -- change third column for row 5
insert into "p.m." values(7,current date,7)
; -- insert an entirely new row 7
select * from "p.m."
select * from "a.m."
; -- report of above SELECT follows:
A 05/02/12 1
3 - 3
5 05/02/12 55
7 05/02/12 7
******** End of data ********


Regards, Chuck

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by 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].