Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Thu, 03 Mar 2005 @ 11:14:56 GMT


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


Subj:   Re: Update/Insert (Upsert)
 
From:   Narayan Murthy

Yes the insert/Select will not work since it is considered as a complex upsert statement since there are restrictions on what can be used with the upsert syntax.

Here is an alternative using bteq's .IF construct.

     update t1 set b =2 where a=1;
     .if activitycount=0 then goto ins_sel_label
     sel * from t1;
     .quit
     .label ins_sel_label
     ins t1 sel 1,1;
     sel * from t1;

Narayan



     
  <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: 28 Jun 2020