Personal tools
You are here: Home Forums DB2 How to declare identity column in db2
Navigation
Log in


Forgot your password?
 
Document Actions

How to declare identity column in db2

Up to DB2

How to declare identity column in db2

Posted by abcd at November 10. 2008

HiĀ  i am doing some migration task from oracle to DB2.In DB2 i came to know that some identity column is there using that we can create sequences and occrances of the insertions and all right ...



can any one share with me ragarding this one pls.



Regards


kanakaraju.Y


Re: How to declare identity column in db2

Posted by perallis at December 04. 2008

Hello kanakaraju.Y,

The following is an example of defining an identity column on the CREATE
TABLE statement:


   CREATE TABLE table (col1 INT,
col2 DOUBLE,
col3 INT NOT NULL GENERATED ALWAYS AS IDENTITY
(START WITH 500, INCREMENT BY 100))

Powered by Ploneboard
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls