Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Quick trigger question
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