Book a Demo

Author Topic: Long time DDL issues- sequences and triggers  (Read 3317 times)

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Long time DDL issues- sequences and triggers
« on: November 26, 2009, 04:24:28 am »
After digging in the forum I came to the conclusion that the DDL generation in terms of sequences and triggers for ORACLE is incomplete, to say the least.

Setting AutoNum=true and checking the "Generate Triggers" as well as "Generate Sequence" does create a sequence and a trigger.
However deselecting the "Generate Trigger" option alone does not create the sequence only but leaves me without both.

Checking "Create Triggers" only returns both.

The statement looks like this:
Code: [Select]
CREATE SEQUENCE NetzpunktVerbindung_Idx_SEQ
INCREMENT BY 1
START WITH
NOMAXVALUE
MINVALUE
NOCYCLE
NOCACHE
NOORDER;

CREATE OR REPLACE TRIGGER SET_NetzpunktVerbindung_Idx
BEFORE INSERT
ON NetzpunktVerbindung
FOR EACH ROW
BEGIN
  SELECT NetzpunktVerbindung_Idx_SEQ.NEXTVAL
  INTO :NEW.Idx
  FROM DUAL;
END;

The trigger is not needed at all here, this is why we switched it off.

Furthermore it is unclear how to set a MAXVALUE and MINVALUE as both are obviously disabled in the sequence statement.
And it should be possible to set the sequence name somewhere.

I appreciate any clues as this is a killer for using the built-in DDL SQL script feature in EA for us.

Regards,

Oliver