Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 25 May 2004 @ 14:09:32 GMT


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


Subj:   Identity Columns
 
From:   Harvat, Joe

I've been playing around with a test table in Teradata V2R5.1 with one, column (INTEGER data type) that is defined as an Identity column. Here's the DDL:

     CREATE SET TABLE test_table ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT
          (
           PRIM_REGION_ID INTEGER GENERATED ALWAYS AS IDENTITY
                (START WITH 1
                 INCREMENT BY 1
                 MINVALUE -2147483647
                 MAXVALUE 2147483647
                 NO CYCLE),
           PRIM_REGION_CD CHAR(6) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL)
     PRIMARY INDEX ( PRIM_REGION_ID );

Using an INSERT SELECT, I loaded 29 rows into the table, believing I would wind up with a series of values in PRIM_REGION_ID that incremented by 1. Instead, I wound up with:

     4
     5
     6
     100004
     100005
     100006
     200002
     300002
     400003
     400004
     500003
     500004
     600004
     600005
     600006
     700005
     700006
     700007
     700008
     800003
     800004
     900003
     900004
     1000005
     1000006
     1000007
     1000008
     1100003
     1100004

Please note that the list shown above is actually from the second time I attempted to load the rows. I deleted the first, similar set of values which started with "1" but incremented following the same interesting pattern you see above. In any event, I am at somewhat of a loss to understand the numbers Teradata generated for this Identity column. Any insights?


Thanks!



     
  <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