Skip to Main Content

SQL Developer Data Modeler

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Generate 12c Identity clause

mmagan-OracleJul 15 2020 — edited Jul 16 2020

Jeff's blog post describes how to generate an identity column. This procedure generates a DDL statement like:

CREATE TABLE table_name (
    id                 NUMBER(18)
       GENERATED BY DEFAULT
       AS IDENTITY

This structure does not allow a null to be included in the insert statement. However, some applications do issue INSERT statements with the ID column.

The solution (as explained here) is to generate the DDL with the 'ON NULL' as:

GENERATED BY DEFAULT ON NULL
AS IDENTITY

Question: How do I do this in SQL Developer Data Modeler?

PS: In an earlier version of this post, I indicated that APEX applications run into this problem. I since learned that, APEX allows you to set a "Query Only" switch on the ID column that prevents this problem.

Comments

Post Details

Added on Jul 15 2020
2 comments
457 views