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

Home -> Community -> Usenet -> c.d.o.server -> Quick trigger question

Quick trigger question

From: <mike_andrew_at_usiva.com>
Date: Thu, 03 Sep 1998 18:51:09 GMT
Message-ID: <6smoeu$3pj$1@nnrp1.dejanews.com>


Creating a trigger on a table to delete the new row once it has already been inserted.

Quick logic would say just delete the row where the row = :new.row

Of course I get the extremely enjoyable mutating table error when I try to insert a row. I really don't have much time to devote to working this out, but I'm sure this is a quick answer for most of you.

Here is the code for the trigger that returns the MT error when a row is inserted.

CREATE OR REPLACE TRIGGER DeleteSession AFTER INSERT ON ccsds_www_session
FOR EACH ROW BEGIN DELETE FROM ccsds_www_session
  WHERE www_session_id = :new.www_session_id   AND www_user_id = :new.www_user_id;

END;
/

Thank you in advance for your help !
Mike

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Sep 03 1998 - 13:51:09 CDT

Original text of this message

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