Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 02 Jun 2005 @ 15:50:54 GMT

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

Subj:   Re: Source data for Multiload!!!
From:   Dennis Calkins

  No, i need an upsert instrction. I got i used named pipes.  


Insert/Select has a cousin called Merge/Into which was implemented in v2r 5.0. Anyway MERGE/INTO is the UPSERT command in SQL.


Using ONline help.

     help 'SQL MERGE';

      *** Query completed. 28 rows found. One column returned.
      *** Total elapsed time was 6 seconds.

     On-Line Help

     MERGE [INTO] tablename [ [AS] aname ]

             { VALUES (expr [...,expr]) }
       USING {                          } [AS] source_tname (cname, [...,cname])
             { ( subquery )             }

       ON match-condition

         UPD[ATE] SET cname = expr [...,cname = expr]

                  {                      [VALUES] (expr [...,expr]) }
         INS[ERT] {                                                 } ;
                  { (cname [...,cname])   VALUES  (expr [...,expr]) }

          The match-condition must fully specify the primary index of the
          target table with equality constraints.

          The subquery variant in the USING clause must fully specify the unique
          primary index, or a unique secondary index, with equality constraints
          so as to ensure that the subquery returns a single row at most.

          Either the WHEN MATCHED or the WHEN NOT MATCHED clause may be
          omitted as long as the other clause of the pair is present.

      BTEQ -- Enter your DBC/SQL request or BTEQ command:

  <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