Triggers in Oracle
How can I use Trigger in Oracle 10g
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.
Javeed M ShaikhPosted Oct 11, 2011, 3:19 AM
You can look at our recommended articles at the right for more information and articles on Trigger in Oracle. Following is a small example:
CREATE OR REPLACE TRIGGER tableChangesTrigger
BEFORE DELETE OR INSERT OR UPDATE ON MyTable
FOR EACH ROW
WHEN (new.col1 > 0) -- This is condition to start trigger processing, you can check for key value here
DECLARE
mvar number;
BEGIN
mvar := :new.col1 - :old.col1; -- :new. will give new values and :old. will give old values
dbms_output.put('Old value: ' || :old.col1);
END;
Please do not forget to mark "Accepted Answer".
Prabhu RajaPosted Oct 11, 2011, 12:24 AM
I have Experience in Sql server only, but i think the concept of using triggers are same for all databases. you may try this E-Book:
Click Here