Topic
1 reply Latest Post - ‏2012-10-19T13:54:55Z by nivanov1
JamesBrooks
JamesBrooks
2 Posts
ACCEPTED ANSWER

Pinned topic How can I get the numeric uid to use as a column "default" value?

‏2012-10-18T19:41:07Z |
Coming from Oracle I have a alter column definition like this:

create table MYFAVTBL ( "ID_USER" DECFLOAT(16));

ALTER TABLE MYFAVTBL ALTER COLUMN "ID_USER" SET WITH DEFAULT uid ;
Is there a way to do that in DB2 ?
Updated on 2012-10-19T13:54:55Z at 2012-10-19T13:54:55Z by nivanov1
  • nivanov1
    nivanov1
    231 Posts
    ACCEPTED ANSWER

    Re: How can I get the numeric uid to use as a column "default" value?

    ‏2012-10-19T13:54:55Z  in response to JamesBrooks
    I don't think DECFLOAT is a good choice for the user ID. Try this:

    create table MYFAVTBL ( "ID_USER" BIGINT GENERATED BY DEFAULT AS IDENTITY);