how to set auto increment column with sql developer

Fendi Tri Cahyono picture Fendi Tri Cahyono · Jun 12, 2012 · Viewed 137.8k times · Source

How do I set a column to increment automatically with Oracle SQL Developer? Why is the form disabled?

Oracle SQL Developer

Note: The image shows the Data Modeler, but the question and top answer talk about editing an existing database.

Answer

Daniel Perník picture Daniel Perník · Dec 11, 2014

If you want to make your PK auto increment, you need to set the ID column property for that primary key.

  1. Right click on the table and select "Edit".
  2. In "Edit" Table window, select "columns", and then select your PK column.
  3. Go to ID Column tab and select Column Sequence as Type. This will create a trigger and a sequence, and associate the sequence to primary key.

See the picture below for better understanding.

enter image description here

// My source is: http://techatplay.wordpress.com/2013/11/22/oracle-sql-developer-create-auto-incrementing-primary-key/