PDA

View Full Version : TO overwrite record if the record does not exist in the table



evlai
05-03-2006, 12:50 AM
Hope someone can really helps me...

I have a master table which contains all the records, and a temp-table which contains temporary records. I need to write a code to perform below:

(1) Check if the Promo ID is existed in the master table
(2) if any promo ID from temp table is existed in the master table, then the record from temp-table will overwrite the record in master table.
(3) if the promo ID is not existed in the master, then the record from temp-table will be appended to the master table.

Thanks :)

OBP
05-03-2006, 04:39 AM
All you need to do is run an update query and an append query.