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:
<code>
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
(1,default,1),(2,default,2),(3,default,3),(4,default,4)
,(5,default,5),(6,default,6)
; -- 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."
except
select * from "a.m."
; -- report of above SELECT follows:
....+....1....+....2....+..
XPMCHAR XPMDATE XPMDECI
A 05/02/12 1
3 - 3
5 05/02/12 55
7 05/02/12 7
******** End of data ********
</code>
Regards, Chuck
As an Amazon Associate we earn from qualifying purchases.