Please help me........
Prakash.
Example of After Insert Trigger in Oracle
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Blocked AccountRank #403 · 6.2K reputationPosted Mar 7, 2013, 11:27 PM EST
Id , Name, Phone etc.
We can define insert trigger like that
CREATE OR REPLACE TRIGGER employerInsert
AFTER INSERT
| ON Employer
FOR EACH ROW
DECLARE
empName varchar2(10);
BEGIN
-- Find username of person performing the INSERT into the table
SELECT user INTO empName
FROM dual;
-- Insert record into audit table
INSERT INTO empHistory
( empId,
Phone,
username )
VALUES
( :new.id,
:new.phone,
empName );
END;
Shankar MRank #874 · 2.5K reputationPosted Apr 26, 2013, 8:39 PM EDT
Assume that You are Inserting a record from Table EMP to Table EMP1.
The After Insert Trigger Should be coded as,
Here :NEW.EMPNO is the EMPNO value that is inserted in the EMP Table.