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 ?
Pinned topic How can I get the numeric uid to use as a column "default" value?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-10-19T13:54:55Z at 2012-10-19T13:54:55Z by nivanov1
nivanov1 100000H9H7231 Posts
Re: How can I get the numeric uid to use as a column "default" value?2012-10-19T13:54:55ZThis is the accepted answer. This is the accepted answer.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);