Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help writing simple trigger.

Re: Help writing simple trigger.

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Sat, 27 Feb 1999 10:36:41 +0100
Message-ID: <36d7bcac$0$11103@newton>


tim.mcconechy wrote

>CREATE TRIGGER UPD_TRG
>BEFORE INSERT OR UPDATE ON dbstruct
>BEGIN
> user_name=user
> lastedit_date=sysdate
> recno=dbstructseq.nextval
>END;
This is not your actual code, is it? I can hardly imagine Oracle prompts you about mutating tables while even the semicolons are missing...

create or replace trigger biu_dbstruct

    before insert or update on dbstruct     for each row
begin

    :new.user_name = user;
    :new.lastedit_date = sysdate;
    if :new.recno is null then

        select dbstructseq.nextval
        into :new.recno
        from dual;

    end if;
end;

Arjan. Received on Sat Feb 27 1999 - 03:36:41 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US