Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Tue, 11 Jan 2011 @ 09:48:31 GMT

  <Prev Next>  
Next> Last>>  

Subj:   MERGE options


Our dwh is relational and it is in the datamarts where we denormalizate the data.

We keep all the history data in the dwh.

Every row has two dates: beginning and ending of the validity of the data.

When we load the new data into the dwh we check:

- Is it new?

- Is it a modification?

In case of a new register we insert it

In case of a modification we update the ending date of the old register and we insert a new row with the new data.

Until now for doing this we are doing first the update and then in another sentence where we insert the new data.

Notice that a modification bring us to an update and to an insert (not only the update) ?Is there any way to do it in one only step for optimazing times? I was trying to use the merge statement but i think that a row only can be inserted or updated.

Any suggestion?

Thanks a lot!!!

  <Prev Next>  
Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023