How to create auto generated ID in volatile table?

Database

How to create auto generated ID in volatile table?

How to create auto generated ID in volatile table?

Tags (1)
5 REPLIES
Enthusiast

Re: How to create auto generated ID in volatile table?

you can tweak a select query with row_number

or you can create

CREATE CREATE MULTISET VOLATILE TABLE tmp (

      Field1 INTEGER GENERATED BY DEFAULT AS IDENTITY

         (START WITH 1

          INCREMENT BY 1

          MAXVALUE 100000000

         ),

      f2 INTEGER);

Re: How to create auto generated ID in volatile table?

This query is giving this error .CREATE TABLE Failed. 5784:  Illegal usage of Identity Column Field1.

Re: How to create auto generated ID in volatile table?

I am inserting multiple values form different queries in volatile table so can't use row_number function.

Enthusiast

Re: How to create auto generated ID in volatile table?

Hi,

From this link 

http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/General_Reference/B035_1096_111A/... shows that it cannot be done.

 Probably,you can find out a way to generate a sequence from any of the queries having unique rows or you can populate or use/ from another/ independent permanent  table as temp and drop it later.

Cheers,

Teradata Employee

Re: How to create auto generated ID in volatile table?