Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 18 Aug 2006 @ 11:56:41 GMT


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


Subj:   Question regarding error message for merge into
 
From:   Anomy Anom

<-- Anonymously Posted: Thursday, August 17, 2006 11:53 -->

I am currently using Teradata v2.6.1 and am trying to complete a merge into statement. My merge was rather complex, and I kept receiving an error, so I tried to create a very simple merge into and am I still getting the same error of 5760 The SELECT subquery from the table reference must fully specify either a UPI value or else a USI value. The team has tried everything we can think of and we are unable to resolve this issue.

In my very simple version, I created a dummy table called dummy_table with two columns (column1 and column2). Column1 is set up as my primary index.

I then tried to run the following SQL:

     Merge into dummy_table as dt
     Using (select 1 as col1, 'FALS' as col2 from s1_test) a1
     On (a1.col1 = column1)
     When matched then
     Update set column2 = a1.col1
     When nont matched then
     Insert (column1, column2)
     Values (a1.col1, a1.col2)

When running this, I get the error mentioned above 5760 The SELECT subquery from the table reference must fully specify either a UPI value or else a USI value.

Can anyone please help me to understand what I am doing wrong and what needs to be done to correct the SQL statement.


Thanks for the help!



     
  <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: 27 Dec 2016