Oracle triggers operations on the same table ____oracle

Source: Internet
Author: User

Yesterday, the head was assigned a task, mainly to write a trigger, used in one of the tables in a field update, the same table will also modify another field.

I yesterday that tangled ah!! For a long time, the main is not played before the trigger, after looking for some information, you can probably read the information on the Internet. However, I really think that there is too much information is in there nonsense, are CTRL + C and CTRL + +, interesting?!

Needless to say, first of all, I want to implement the operation of the same table, of course, when a field changes need to change the other field of the operation must be completed before the update, if completed after update, there will be deadlock phenomenon.

The specific trigger creation code is as follows:

Create or Replace Trigger Rudi_trigger
Before update of Inde_value on Rundata_up_daily_inde
For each row
Declare
--Local variables
Begin
If
: Old.id =:new.id
Then
: New.is_update:=1;
End If;
End Rudi_trigger;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.