How do you Generate Sequence in Teradata?

Sequences can be generated in Teradata using the existing functions

  • for storing purpose : Identity Column
      • syntax:
        SEQ_NUM decimal(10,0) NOT NULL GENERATED ALWAYS AS IDENTITY
                   (START WITH 1
                    INCREMENT BY 1
                    MINVALUE 1
                    MAXVALUE 2147483647
                    NO CYCLE)

        generated always/by default as identity

      • (start with <value> increment by <value> min<value> max<value> no cycle)
      • Identity columns do not guarantee a sequence – they only guarantee unique ids because the increment by 1 is handled vproc local
  • for display purpose : CSUM 

Leave a Reply

Your email address will not be published. Required fields are marked *