Define Identity Columns on SQL Modeler 23

I always used JDeveloper for Database Design, but this project doesn't have a new release since 2017 and it's last supported Oracle Version was 12c. Now I have to design a data Base for Oracle 19c so I tried SQL Developer Data Modeler and I've had some problems adapting to this new tool.

I have a table with ID and I want this to be type number and generated always as identity, something like this

CREATE TABLE my_table (
    id_my_table  NUMBER
        GENERATED ALWAYS AS IDENTITY ( START WITH 1 NOCACHE ORDER )
    NOT NULL,
    name      VARCHAR2(100) NOT NULL,
    ....

Here are the steps to achieve this. 

  1. First, let's make sure that the diagram is using a recent version of Oracle, right click on your model and select properties



    And make sure the RDBMS values are set to Oracle Database 12c or greater



     
  2. Go to Tools > Preferences, then go to Data modeler > Model and check the db Version



  3. Now, got to Data Modeler / Model / Physical and change "Default Identity DDL" value to "IDENTITY clause"

  4.  Now modify your table and set the type of your column to a numeric one like "Numeric"
  5. Double click on your column to access to column properties window
  6.  On General Setting, mark "Auto Increment" and "Identity Column" options


  7.  Now go to "Auto Increment" and uncheck "Generate Trigger" option



  8. You can change the option "Generate" to "by Default" if you want the Identity column is applied if the value is null or "Always" if you want that this can not be set on insert.

Now when you generate the DLL, it will look like this:


Now you can continue with the columns of other tables.... Celebrate that you did it!!!

The featured video for today id "Relax in the City"...  I need to relax after stressing trying to find these options.




Comments

Popular posts from this blog

View PDF File on APEX (Simple approach)

Set Custom APP Icon on APEX

ID Basado en trigger y secuencia para todas las tablas - Oracle