You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by James Stauffer <js...@spscommerce.com> on 2004/05/12 22:47:10 UTC

oracle.sql

One more update to the trigger.  I couldn't get it to work without the
variable.  I am not familiar with triggers very much but our app uses a lot
of them so I have a lot of examples that are very close to this.  Basically,
I don't know if this is the best way but it seems to work well.

CREATE TRIGGER logging_event_id_seq_trig
  BEFORE INSERT ON logging_event
  FOR EACH ROW
  declare l_newpk logging_event.event_id%type;
  BEGIN
    SELECT logging_event_id_seq.NEXTVAL
    INTO   l_newpk
    FROM   DUAL;
    :new.event_id:=l_newpk;
  END logging_event_id_seq_trig;
/

James Stauffer