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!

DM 23.1 Synchronise to Data Dictionary produces Java errors - default on null??

AndyHNov 30 2023

I have a design that has been created entirely with DM.

When I synchronise to one database all goes well, when I synchronise to another database I get messages about ‘Design Errors’ and the log file contains JAVA errors.

As far as I can see, the schema on both databases is the same e.g.

Good DB:
create table MENU_STRUCTURE
(
  id              RAW(16) default sys_guid() not null,
  app_id          NUMBER not null,
  label           VARCHAR2(80),
  page            NUMBER,
  parent_id       RAW(16),
  sort_order      NUMBER,
  created_by      VARCHAR2(100) default on null coalesce(sys_context('APEX$SESSION', 'APP_USER'),
                                                      sys_context('USERENV', 'SESSION_USER')) not null,
  created_on      DATE default on null sysdate not null,
  last_updated_by VARCHAR2(100) default on null coalesce(sys_context('APEX$SESSION', 'APP_USER'),
                                                           sys_context('USERENV', 'SESSION_USER')) not null,
  last_updated_on DATE default on null sysdate not null,
  parameters      VARCHAR2(240),
  entry_type      VARCHAR2(1) default 'P' not null,
  coo_required    VARCHAR2(1) default 'Y'
)
Bad DB:
create table MENU_STRUCTURE
(
 id              RAW(16) default on null sys_guid() not null,
 app_id          NUMBER not null,
 label           VARCHAR2(80),
 page            NUMBER,
 parent_id       RAW(16),
 sort_order      NUMBER,
 created_by      VARCHAR2(100) default on null coalesce(sys_context('APEX$SESSION', 'APP_USER'),
                                       sys_context('USERENV', 'SESSION_USER')) not null,
 created_on      DATE default on null sysdate not null,
 last_updated_by VARCHAR2(100) default on null coalesce(sys_context('APEX$SESSION', 'APP_USER'),
                                            sys_context('USERENV', 'SESSION_USER')) not null,
 last_updated_on DATE default on null sysdate not null,
 parameters      VARCHAR2(240),
 entry_type      VARCHAR2(1) default 'P' not null,
 coo_required    VARCHAR2(1) default 'Y'
)

Synchronise DDL

-- Error while generating DDL for ID. See log file for details.
ALTER TABLE menu_structure MODIFY (
   parent_id
);

Logs

SEVERE    339    122807    oracle.dbtools.crest.util.logging.Logger    Error while generating DDL for ID
2023-11-30 13:48:20 SEVERE - Error while generating DDL for ID
java.lang.NullPointerException

DDL Preview from DM

CREATE TABLE menu_structure (
   id              RAW(16) DEFAULT sys_guid() NOT NULL,
   app_id          NUMBER NOT NULL,
   label           VARCHAR2(80),
   page            NUMBER,
   parent_id       RAW(16),
   sort_order      NUMBER,
   created_by      VARCHAR2(100) DEFAULT ON NULL coalesce(sys_context('APEX$SESSION', 'APP_USER'),
                                                     sys_context('USERENV', 'SESSION_USER')) NOT NULL,
   created_on      DATE DEFAULT ON NULL sysdate NOT NULL,
   last_updated_by VARCHAR2(100) DEFAULT ON NULL coalesce(sys_context('APEX$SESSION', 'APP_USER'),
                                                          sys_context('USERENV', 'SESSION_USER')) NOT NULL,
   last_updated_on DATE DEFAULT ON NULL sysdate NOT NULL,
   parameters      VARCHAR2(240),
   entry_type      VARCHAR2(1) DEFAULT 'P' NOT NULL,
   coo_required    VARCHAR2(1) DEFAULT 'Y'
);

The difference between ‘Good’ and ‘Bad’ seems to be the default “on null” option, not sure why this would cause an issue?

Comments
Post Details
Added on Nov 30 2023
5 comments
133 views