There are two table A and B.
Fields of A :- Aid(PK), name, isactive, cdate, Bid
Fields of B:- Bid(PK),name,isactive ,cdate
There is no FK relation between A and B.
Trigger1:- If I insert new rocord in table A, new record with this data must be inserted in B table automatically. And Bid of table A must be updated by Bid of B in same record.
Example:
Insert into A values(1,’Pawan’,’Y’,’2008-10-16’);
After inserting this record data must be like below in tables….
Table A
1
Pawan
Y
2008-10-16
10
Table B
10
Pawan
Y
2008-10-16
Trigger2:- If I update any value in any record in table A, same must be updated in table B respectively.
Example:
Update A set name=’Kumar’ where Aid=1;
After this update data must be like below in tables..
Table A
1
Kumar
Y
2008-10-16
10
Table B
10
Kumar
Y
2008-10-16