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!

Error in the DDL generation

itshakSep 16 2015 — edited Sep 17 2015

I created a Relational model with some tables and FK between them.

When I generate the DDL for the previous model, I receive some wrong results:

1) DDL for the schema is nor created even that Tools > Preferences > Data Modeler > DDL > "include schema in DDL" is checked

    My model contain one schema named food

2) The DDL contain lines like

     --  ERROR: Invalid View V_Difficulty

     ALTER VIEW Food.V_Difficulty ADD CONSTRAINT Difficulty_PKv1 PRIMARY KEY ( DifficultyId ) DISABLE ;

  when there is not a previous "create view" statement for: Food.V_Difficulty in the DDL script generated by the SQL Data Modeler.

  I try to remove all theses view from the relational model and save the design but when opening again the design, these views appears again.

  There is one view named v_tablename for every table in the relational model. I don't created directly these views. Maybe I selected some option on some wizard that create them but I don't remember.

3) For the main/master table of my relational model, the DDL contain a trigger with some added columns that also I don't created directly

    Also, the trigger is created in "emp2" when I don't have any table named emp2 on my model !

CREATE OR REPLACE TRIGGER Food.Recipe_JNtrg

  AFTER

  INSERT OR

  UPDATE OR

  DELETE ON emp2 for each row

Declare

  rec Food.Recipe_JN%ROWTYPE;

  blank Food.Recipe_JN%ROWTYPE;

  BEGIN

    rec := blank;

    IF INSERTING OR UPDATING THEN

      rec.RecipeId := :NEW.RecipeId;

     ...

      rec.JN_DATETIME := SYSDATE;

      rec.JN_ORACLE_USER := SYS_CONTEXT ('USERENV', 'SESSION_USER');

      rec.JN_APPLN := SYS_CONTEXT ('USERENV', 'MODULE');

      rec.JN_SESSION := SYS_CONTEXT ('USERENV', 'SESSIONID');

      IF INSERTING THEN

        rec.JN_OPERATION := 'INS';

      ELSIF UPDATING THEN

        rec.JN_OPERATION := 'UPD';

      END IF;

    ELSIF DELETING THEN

      rec.RecipeId := :OLD.RecipeId;

     ...

      rec.JN_DATETIME := SYSDATE;

      rec.JN_ORACLE_USER := SYS_CONTEXT ('USERENV', 'SESSION_USER');

      rec.JN_APPLN := SYS_CONTEXT ('USERENV', 'MODULE');

      rec.JN_SESSION := SYS_CONTEXT ('USERENV', 'SESSIONID');

      rec.JN_OPERATION := 'DEL';

    END IF;

    INSERT into Food.Recipe_JN VALUES rec;

  END;

  /

I write this question after I tried, without success, other operations like create a new model and copy table-table from the old model to the new model.

SQL Developer Data Modeler Version 4.1.1.888

OS Win7 64bits

It's the version 4.1 a stable version?

Isaac

This post has been answered by David Last-Oracle on Sep 17 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2015
Added on Sep 16 2015
6 comments
2,671 views