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!

LinkWithin

Related Posts Plugin for WordPress, Blogger...