Unable to delete record in trigger.
Can we write Delete statement in After Update Trigger in Oracale?
For Example : -
My Trigger :
Create or replace
TRIGGER TranxMaster_after_update
AFTER UPDATE ON Transaction
FOR EACH ROW
DECLARE vcrTranxID VARCHAR2(100);
BEGIN
INSERT INTO TRANSACTIONNew
( ID,
MOBILENO,
TrnTYPE,
AMOUNT,
TranxID)
VALUES
( :new.ID,
:new.MOBILENO,
:new.TrnTYPE,
:new.AMOUNT,
:new.TranxID)
SELECT TranxID INTO vcrTranxID FROM TransactionNew WHERE ID=:new.ID;
IF vcrTranxID IS NOT NULL THEN
DELETE FROM Transaction WHERE ID = :new.ID;
End IF;
END;
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Rupali ShindePosted Mar 9, 2017, 5:45 AM
Subhashkumar YadavPosted Mar 9, 2017, 5:33 AM
Rupali ShindePosted Mar 9, 2017, 5:16 AM
Subhashkumar YadavPosted Mar 9, 2017, 5:01 AM
Rupali ShindePosted Mar 9, 2017, 4:44 AM