Book a Demo

Author Topic: Enterprise Architect, database trigger generation  (Read 4314 times)

Martin Dürrmeier

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Enterprise Architect, database trigger generation
« on: July 18, 2012, 09:02:52 pm »
Problem:

I'm generating triggers for a oracle db with EA 8.0 by defining the primary key as a number(18,0) and setting the AutoNum in column properties to True.

http://i.stack.imgur.com/WaXYQ.png
Then selecting following checkboxes in the 'Generate DDL' Dialog

http://i.stack.imgur.com/ntvJx.png
What EA generates for a trigger is
Code: [Select]
CREATE OR REPLACE TRIGGER TRG_Foo_id
BEFORE INSERT
ON Foo
FOR EACH ROW
BEGIN
    SELECT SEQ_Foo_id.NEXTVAL
    INTO :NEW.id
    FROM DUAL;
END;;

Inserting that trigger into PL/SQL Developer it shows a compile error with the message

Code: [Select]
PLS-00103: Found Symbol ";" When doing a
Code: [Select]
select * from SYS.USER_ERRORSWhen not specifing a 'SQL Terminator' the trigger is created (because the create statement ends with one semicolon instead of two) without any error but then all other create table statements do not end with a semicolon which leads to a 'ORA-00922: missing or invalid option' because the statements are not separated by semicolon.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Enterprise Architect, database trigger generat
« Reply #1 on: July 18, 2012, 09:17:47 pm »
Martin,

I you haven't done so, the procedure is:
- test using the latest version of EA t make sure it hasn't been fixed in the meantime
- if not fixed report the bug to Sparx

Geert

Martin Dürrmeier

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Enterprise Architect, database trigger generat
« Reply #2 on: July 18, 2012, 11:25:44 pm »
Thanks Greet, I tried the same with version  9.3.934. Works so it seems to be a Bug in the old version