Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 02 Mar 2006 @ 19:28:46 GMT


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


Subj:   Autonumber as Composed Key
 
From:   cassiano.aleksander

Situation: At SQL Assistant, I need to create a table using an autonumber field as part of a composed primary key

Complication: When I set that autonumber field on UNIQUE PRIMARY INDEX statement, I get an error msg 5784 - "illegal use of identity field".

What am I doing wrong? Where can I find more details about this kind of error msg?

Eg:

     CREATE TABLE LIB.TABLE
          (   Transaction_ID INTEGER TITLE 'Transaction ID' NOT NULL
     GENERATED BY DEFAULT AS IDENTITY
     (START WITH 1
     INCREMENT BY 1
     MINVALUE 1
     MAXVALUE 999999999
     NO CYCLE),
           Party_ID INTEGER TITLE 'Party ID' NOT NULL)
     UNIQUE PRIMARY INDEX ( Transaction_ID , Party_ID );

The intention is to have a table like if we have this on the table:

     Transaction_ID    Party_ID
     1                       1
     1                       2
     2                       1

Rgds

Cassiano



     
  <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