Re: Mutating tables

From: Ken Denny <kedenny_at_mail.concentric.net>
Date: 1996/01/13
Message-ID: <4d77uf$e1s_at_spectator.cris.com>#1/1


rlong01_at_dallas.net (Richard Long) wrote:
>I'm moving a system from sybase to oracle and am having some problems
>with triggers. I've followed the doc to set-up a trigger to set a key
>to -1 everytime the table is inserted. It no longer mutates but the
>update from the trigger does not take place. What is a good way to
>make this happen. Trigger follows:
 [ Trigger code deleted]
>Thanks
>

WHat exactly are you trying to do with this trigger. It looks like you simply want to set acu_stdld_key_i to -1 whenever a new record is added. If that's the case then all you need is:

Create or replace trigger ti_attachee
before insert on attachee /* could be before or after */ for each row
begin

   :new.acu_stdld_key_i:= -1;
end;

For one thing, if this trigger fires on an insert then :old.anything is going to be null.

I hope I've understood what you're trying to do.

Regards
Ken Denny

PS. Sorry about the snipping but my server won't allow me to post unless there is more new text than included text. Received on Sat Jan 13 1996 - 00:00:00 CET

Original text of this message