Book a Demo

Author Topic: EA11 - Generating Triggers DDL  (Read 4408 times)

Morcous

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
EA11 - Generating Triggers DDL
« on: April 01, 2015, 08:38:34 am »
Hello, I'm a little new to EA (only been using it for a few months), and I'm new to these forums.

I'm seeing an issue with DDL generation of Sequences.

For a sequence (on OWNER.TABLE_NAME), it generates:

--  Create Triggers
CREATE SEQUENCE owner.sequence_name
    INCREMENT BY 1
    START WITH 1
    NOMAXVALUE
    MINVALUE 1
    NOCYCLE
    NOCACHE
    NOORDER
;



CREATE OR REPLACE TRIGGER owner.TRG_table_name
      BEFORE INSERT
      ON table_name
      FOR EACH ROW
      BEGIN
            SELECT owner.sequence_name.NEXTVAL
            INTO :NEW.column_name
            FROM DUAL;
      END;
/

The problem is in bold... the TABLE_NAME isn't being prefaced by the Owner name. Does anyone know a fix? Is this a bug?

hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: EA11 - Generating Triggers DDL
« Reply #1 on: April 02, 2015, 08:15:44 am »
With EA version 12, you can modify the DDL Generation template to add the owner name to the table name.

Open the DDL Template editor from menu Package | Database Engineering | Edit DDL Templates...

Select Language: Oracle, then select the DDL Column Extras template. In the CREATE TRIGGER statement near the bottom of the template, change the line ...

Code: [Select]
$trigger += "      ON " + $tableName + " \n"to ...

Code: [Select]
$trigger += "      ON " + $owner + "." + $tableName + " \n"

Morcous

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: EA11 - Generating Triggers DDL
« Reply #2 on: April 02, 2015, 08:34:05 am »
Thank you for the reply, gne.

I tried looking for similar functionality in EA version 11 and couldn't find it.
Can you confirm that it doesn't exist in version 11?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: EA11 - Generating Triggers DDL
« Reply #3 on: April 02, 2015, 09:01:58 am »
There were no DDL generation templates in v11