I am obviously missing something simple here but I cannot figure it why this does not work. I created a script below to demonstrate the issue. I have one main table called enc which has unique key encid for that table. I also created a copy of that key as enc2.
Then I have another table called ord, which has multiple rows per encid. I need to do an append to ord table (this will be used for incremental load process).
I expect ord table populated like that if the script runs properly:
thanks for your reply, Gysbert. what I need is to add all order rows to a final ord table if there are encid values in enc table. Enc table is a driving table that will only have encid which were added recently or modified (this will be used in incremental process).