Create GENERATED BY DEFAULT AS IDENTITY Column in Teradata

Database

Create GENERATED BY DEFAULT AS IDENTITY Column in Teradata

Hi All,

I we are facing issue with below IDENTIFY column when creating mentioned table. 

Ex.:-

CREATE MULTISET TABLE Auto_Fill_Column (

      a1 INTEGER GENERATED BY DEFAULT AS IDENTITY

         (START WITH 1

          INCREMENT BY 20

          MAXVALUE 1000

         ),

      a2 INTEGER);

Error Related to NoPI column in Table

1 REPLY
Junior Contributor

Re: Create GENERATED BY DEFAULT AS IDENTITY Column in Teradata

Your system seems to be set to "No Primary Index" as default when no PI is specified in the Create Table.

NoPI tables don't support IDENTITY (don't ask me why).

So add a Primary Index to your definition, either on a1 or on a2, depending on your needs.