Sunday, 1 June 2014

Auto Increment trigger from SQL Developer Data Modeler In Oracle Database 11g R2

As Database 12C is concern It's new Auto increment feature stated as you can add Sequence.nexval as a default value while table is being created.

I'm discussing Auto increment technique using SQL Developer Data Modeler. And you can use this technique to insert auto next value on Oracle forms while development. it'll decrease your effort and time to have pre-insert trigger to get sequence next value into Primary key attribute in Data block of Oracle forms.


  • Open up your SQL Developer Data modeler.
  • Right click on logical model > show
  • Draw entity and make attributes with logical data type.
  • Check PK UID with your unique identifier.






Save your model.
  • Engineer to Relational model.




  • Double Click on Entity you want to add auto increment of it's PK attribute
  • Double click on Entity and then Double Click Primary key attribute at which you want to add auto increment
  • In general check Auto increment option.

  • Go to Auto Increment and update fields according to your business logic.



  • Generate Code. (if you are working on existing Database then use synchronize)


  • Your Sequence and trigger will be auto generated.






Now in forms builder don't get Primary key attribute in your LAYOUT wizard.

No comments:

Post a Comment