Oracle Auto increment trigger HOWTO

Oracle SQL Developer is full of nice feature, damned by a overwhelming options pane, like the one I will describe to you right now.

Even if  Oracle databases (<12) does not support auto increment, you can easily ask to your sql data modeler to generate for you a sequence and a trigger in a automatic way.

Sql data modeler is the Oracle Sql Developer  internal application used to design database model: it is like ER-Win, it works only for Oracle (but who needs the open source SQLite and PostgreSQL on these days? :) Because the SQL Developer was designed with very low usability in mind, this article aim to help you

  1. From Data Modeler browser, expand the table name and click on the column you want to auto-increment. Then right-click and select Properties
  2. In the General panel select "Autoincrement" check box.
  3. In the Auto Increment panel check the "Generate Trigger" check box. Also we suggest you to put the Sequence name (click to enlarge picture):