Here is the trigger
I have tested this as follows:Code:create or replace trigger testtableinsertupdate after insert or update on testtabe referencing New as n For Each Row Begin Insert Into Table1 (Name,Age,MailID,DateTime) Values ( :n.Name, :n.Age, :n.MailID, :n.DateTime); End;
1 created two tables:
2. Insert a row into testtableCode:Create Table Testtable ( Name varchar2(20), Age number, MailID varchar2(20), DateTime Date); Create Table Table1 ( Name varchar2(20), Age number, MailID varchar2(20), DateTime Date);
3. Checked the data in table Table1 and saw the entered new row.Code:Insert Into TestTable Values ('Gary',10,'gary','20-May-07');
4. Inserted a new row into testtable
5. Check data in Table1Code:Insert Into TestTable Values ('Sam',11,'sam','21-May-07');
Saw two rows Gay and Sam
6. Updated a row in testtable
7. Checked data in Table1Code:Update TestTable Set age = 50 Where Name = 'Gary";
Saw Three rows 'Gay' at age 10, Sam and Gary at age 50




Reply With Quote