Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 26 Jun 2012 @ 14:58:22 GMT


     
  <Prev Next>  
<<First
<Prev
Next>
Last>>
 


Subj:   Error in Modify the history data
 
From:   Anomy Anom

<-- Anonymously Posted: Tuesday, June 26, 2012 08:52 -->

Hi Gurus,

I have the master table section with columns department_cd, section_cd and description. I want to update the history data in detail table by joining the above master table.

The issue is that we have multiple departments (for ex with code 1) and multiple sections also (with code 1). When I run the update statement for the main table I get the error UPDATE FAILED: Target row updated by multiple Source rows, which is correct.

What we want here is to map department with section. For this we have to take any random value (viz either 99,68,64,73,62 or 75) for section for the same department and modify the history data in the main table. (sample data from section table is below)

     Dept   Section     Desc
     1           99     GROCery 1
     1           68     GROCERY 2
     1           64     GROCERY 3
     1           63     GROCERY 4
     1           73     GROCERY 5
     1           74     GROCERY 6
     1           62     GROCERY 7
     1           75     GROCERY 8
     1            2     GROCERY 9
     2            1     PETS
     2           40     POULTRY

Can somebody help me with the update statement for this modification please...

Many Thanks in advance.



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