Great thanks,

Pieter


On 21/05/2017 16:09, Liu, Ming (Ming) wrote:

R2.1.0 support ‘Identity column’ as well. The documentation was not updated in R2.1.

If you do not specify the primary key in the DDL, Trafodion will generate a system hidden column ‘SYSKEY’ as the primary key (Anoop mentioned below). However, it is a random unique number, you cannot use it in the query as a key to lookup, so it is recommended to use primary key.

thanks,

Ming

*From:*pieter gmail [mailto:[email protected]]
*Sent:* Sunday, May 21, 2017 2:16 AM
*To:* [email protected]
*Subject:* Re: auto generated primary keys

Hi,

Yes that is it thanks.
I was reading 2.1.0 as that's the docker I installed. Don't see Identity Column mentioned there.
I'll try to install 2.2.0.

Is it correct then to define a auto increment primary key as,

|CREATE TABLE identity_employee (|
|  id LARGEINT GENERATED ALWAYS AS IDENTITY,|
|  description VARCHAR(40),|
|  PRIMARY KEY (id)|
| );|


As an aside, I see in section 3.17.1 that "A PRIMARY KEY constraint is required in Trafodion SQL." However I see many examples where the primary key is not specified. Is there some default happening in this case?

Thanks
Pieter

On 20/05/2017 19:55, Eric Owhadi wrote:

    Hi Pieter,

    Did you look at section 5.11 Identity Column?

    Is it what you are looking for?

    Regards,

    Eric

    -----Original Message-----

    From: pieter gmail [mailto:[email protected]]

    Sent: Saturday, May 20, 2017 12:41 PM

    To:[email protected]
    <mailto:[email protected]>

    Subject: RE: auto generated primary keys

    Hi,

    Does/will trafodion support auto generated primary keys?

    I can not see any mention of it in the docs.

    Thanks

    Pieter


Reply via email to