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