Setting auto increment property in Oracle 11g is a little bit different from way that I am used to with other databases. There is no such keyword as auto_increment in Oracle 11g. We have to achieve it by using the codes below.
STEP 1 - Connect and Grant
First of all you need to connect with the user. This user has to be granted necessary resources. So make sure your user has the permission to create an manage tables.
STEP 2 - Create a Table
STEP 3 - Define a Primary Key
STEP 4 - Create a Sequence
STEP 5 - Create a Trigger That Will Increment The ID
Hope to see you in the next blog post!
Selen
No comments:
Post a Comment