Oracle triggers if inserting updating

There are optional declaration and exception sections, like any other PL/SQL block, if required.

The "dml-event" can be one or more of the following.

Many applications update all of the columns in a table -- setting them to their old value, rather then trying to figure out exactly which columns have been updated by the client. create or replace trigger test_trigger 2 after update of x,y on test 3 for each row 4 begin 5 if updating( 'X' ) then 6 dbms_output.put_line( 'X is being updated' ); 7 end if; 8 9 if updating( 'Y' ) then 10 dbms_output.put_line( 'Y is being updated' ); 11 end if; 12 end; 13 / Trigger created.

Hello, I am not familiar with Oracle at all, but I find myself in a situation where I need to build a update trigger for one of our tables.

This trigger needs to update a tracking table anytime any of the fields get updated.

"WHERE 1 = 2" means: create a table with all columns as the original one, but make it empty (because no records satisfy "1 = 2" condition).

Add two more columns: action (I - insert, U - update, D - delete) and datum (timestamp which will tell us when something happened).


Leave a Reply

  1. Web cam live sex cissy 29-Sep-2017 05:23

    For that reason, we are devoting this portion of the web site to HIV and AIDS support.

  2. russian jewish dating site 27-Sep-2017 22:09

    Tyler professed his innocence, but a band confidant later told Perry that Tyler had indeed taken the money.

  3. two medical students dating 05-Sep-2017 11:19

    When Dan’s book is being published, he hires Anna, played by Heather Bucsh, to be his photographer.

  4. Free mobile sex chat online with out join 13-Sep-2017 20:27

    Also the gameplay will change considerably as it will be a visual novel, made with the freeware Ren'Py.