XXX Chats

dangers of dating an older man

Pl sql inserting updating

A database trigger is a stored procedure that automatically executes whenever an event occurs. Oracle initiates an ‘AFTER INSERT’ trigger after an insert event has been occurred and an ‘AFTER UPDATE’ trigger after an update event has been occurred.

CREATE or REPLACE TRIGGER emp_after_update AFTER UPDATE OF empid ON emp FOR EACH ROW DECLARE BEGIN update emp_backup set empid = :new.empid where empid = :old.empid; DBMS_OUTPUT.

PUT_LINE('empid successfully updated into emp_backup table'); END; The above trigger named ’emp_after_update’ will be initiated whenever ’empid’ column in ’emp’ table gets updated.

Now before updating ’empid’ column in ’emp’ table see the ’emp’ and ’emp_backup’ table records.

Vishwanath Dalvi is a gifted engineer and tech enthusiast. When not hacking around or supporting the open source community, he is trying to overcome his phobia of dogs.

When you sign in to comment, IBM will provide your email, first name and last name to DISQUS.

sal_diff); END; / keyword if you want the trigger to query or change the same table, because triggers can only do that after the initial changes are applied and the table is back in a consistent state.

Because the trigger uses the clause, it might be executed multiple times, such as when updating or deleting multiple rows.

Comments Pl sql inserting updating