Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 08 Feb 2010 @ 14:01:07 GMT

  <Prev Next>  
Next> Last>>  

Subj:   Error 2801 in an insert query using left outer join
From:   Antony Kavin Bosco

Hi All,

I am using an insert query with left outer join condition as below:

     Insert into T2
     Select T1.D,T1.A, T1.B, T1.C
     From T1 Left outer joinT2
     Where T2.D is null;

Also say,

Table T1 has 100 rows and T2 is empty

T1 has NOT NULL values for A,B,C and D

T1 has primary index with columns A,B and C

T2 has unique primary index with columns A,B and C

Now when I run this query, I get an error as "2801 Duplicate unique prime key error in T2"

Since the target table is empty, I am confused on how I could get a duplication error over there. Kindly help me out.

Thanks in advance,


  <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