Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 15 May 2013 @ 09:26:09 GMT


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


Subj:   Issues with generated Identity columns
 
From:   Sukul Mahadik

Hello All

I am facing an issue with Generated identity columns.

I have two identical tables with same definition as shown below :

     CREATE SET TABLE EMPLOYEE5 ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT,
          DEFAULT MERGEBLOCKRATIO
          (
           EMPLOYEEID INTEGER GENERATED ALWAYS AS IDENTITY
                (START WITH 1
                 INCREMENT BY 1
                 MINVALUE 1
                 MAXVALUE 4
                 CYCLE),
           EMPLNAME CHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC) PRIMARY INDEX ( EMPLOYEEID );

     CREATE SET TABLE EMPLOYEE4 ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT,
          DEFAULT MERGEBLOCKRATIO
          (
           EMPLOYEEID INTEGER GENERATED ALWAYS AS IDENTITY
                (START WITH 1
                 INCREMENT BY 1
                 MINVALUE 1
                 MAXVALUE 4
                 CYCLE),
           EMPLNAME CHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC) PRIMARY INDEX ( EMPLOYEEID );

EMPLOYEE4 is populated with following rows

     EMPLOYEEID    EMPLNAME
         2         shushant
         1         sukul
         3         bhanu

Employee5 is empty.

Now I perform a query as below

     INSERT INTO EMPLOYEE5 SELECT * FROM EMPLOYEE4;

I was expecting sequential values for employee-id in EMPLOYEE5, but following is how the table looks like

     EMPLOYEEID   EMPLNAME
         1        bhanu
         1        sukul
         1        shushant

I am not sure what went wrong.

Any kind of help is appreciated .


Thanks in advance.

Sukul



     
  <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