|
|
|
Re: Dear i want that when a user change or delete any record or row in forms data automatically move [message #537015 is a reply to message #537004] |
Mon, 26 December 2011 00:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/1a1521015d9a03844ff8ce26f7be1429?s=64&d=mm&r=g) |
x-oracle
Messages: 380 Registered: April 2011 Location: gujarat
|
Senior Member |
|
|
this tigger also help full you try this also
we create tigger on scott.emp table so before use this tigger you create another new table name emp1 also and after that use this tigger
createorreplacetrigger trig_1 BEFOREDELETEORINSERTORUPDATEonemp
forEACHROW
BEGIN
IF DELETING THEN
INSERTINTOEMP1(ENO,ENAME)
VALUES(:OLD.ENO,:OLD.ENAME);
INSERTINTOEMP1(ENO,ENAME)
VALUES(:NEW.ENO,:NEW.ENAME);
ELSIF INSERTING THEN
INSERTINTOEMP1(ENO,ENAME)
VALUES(:OLD.ENO,:OLD.ENAME);
INSERTINTOEMP1(ENO,ENAME)
VALUES(:NEW.ENO,:NEW.ENAME);
ELSIF UPDATING THEN
INSERTINTOEMP1(ENO,ENAME)
VALUES(:OLD.ENO,:OLD.ENAME);
INSERTINTOEMP1(ENO,ENAME)
VALUES(:NEW.ENO,:NEW.ENAME);
ELSE
DBMS_OUTPUT.PUT_LINE('HI');
ENDIF;
END;
/
|
|
|
|
|
|
|
|