Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 28 Jan 2013 @ 10:26:19 GMT


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


Subj:   MERGE Failed 5977: Invalid MERGE-INTO statement
 
From:   Koushik Chandra

Hi,

I am getting 5977 error during merge. Please suggest how to resolve.

     MERGE INTO   C1
     USING
     (
            SELECT
                  COL1
                 ,COL2
                 ,COL3
                 ,COL4
                 ,COL5
                 ,COL6
                 ,COL7

            FROM 
     ) C2

     ON  C1.COL1 = C2.COL1
     AND C1.COL2 = C2.COL2
     AND C1.COL3 = C2.COL3
     AND C1.COL4 = C2.COL4

     WHEN MATCHED THEN UPDATE
        SET
                  COL5 = C2.COL5
                 ,COL6 = C2.COL6
                 ,COL7 = C2.COL7

Now Table1 structure is something like below :

     CREATE MULTISET TABLE TABLE ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT,
          DEFAULT MERGEBLOCKRATIO
          (
           COL1 CHAR(32) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
           COL3 CHAR(6) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
           COL4 CHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
           COL5 DECIMAL(2,0) NOT NULL,
           COL6 CHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
           COL2 CHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
           COL7 BIGINT NOT NULL)
     PRIMARY INDEX ( COL1 )
     PARTITION BY RANGE_N(CAST((COL5) AS SMALLINT) BETWEEN 1  AND 10  EACH 1 ,
     NO RANGE)
     INDEX ( COL3 );

Regards,

Koushik Chandra



     
  <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