Saturday, June 15, 2013

How to add Sequence Generator to a table in Oracle SQL Developer Data Modeler


Nowadays, most of the database design will use a running sequence number as the table's Primary Key instead of a code column, especially for compound key to reduce the complexity to reference to the table.

Thus, this post will show how to define a Sequence Generator for a table in Oracle SQL Developer Data Modeler.

Assumed that a table already created, with a number type column as the PK shown below.
table with PK is number type


Steps:
1. Open the Table Properties
    a) R-click on the table > properties OR d-click on the table
    b) Click on Columns node.
table properties

2. Open the Column Properties for the PK
    a) d-click on selected column
column properties for PK

2. Configure for auto increment and sequence generator.
    a) in General node, check Auto Increment
    b) in Auto Increment node, enter Sequence Name
    c) click OK


Done!

4 comments:

  1. Hello . I don't seem to find out the dialogs you have mentioned .

    I am using version 3.2.20.09 Build MAIN-09.87 of sql developer

    Appreciate your help

    ReplyDelete
    Replies
    1. Hi Melvin,
      I guess you are not using Oracle SQL Developer Data Modeler.
      It is different software from Oracle.
      Please refer here for more details about Oracle SQL Developer Data Modeler.

      Delete
  2. Just what I was looking for. Thanks

    ReplyDelete

LinkWithin

Related Posts Plugin for WordPress, Blogger...