Oracle a diagram of how triggers and end statements are triggered

Source: Internet
Author: User

Triggers in Oracle are a very useful technique, unlike stored procedures and functions, where stored procedures and functions require the user to display a call to execute, and the trigger is run by an event to start. That is, the trigger is when an event occurs automatically implicitly run, that is, can be very force to monitor the operation of the user, which makes the trigger can help us do something that makes every programmer happy: The specification of user input, in the user input of non-logical data in a timely manner to prevent and prompt him, maintain the rationality of the data.

First, the basic use of triggers is explained by a graph:



So how to interrupt an unreasonable operation ... Well, that's actually the meaning of the word, the exception is thrown, by throwing an exception to terminate the execution of the statement, here is an example:

This terminates the statement when the user enters a current age less than the previous age, and the terminated statement has no effect on the database















Oracle a diagram of how triggers and end statements are triggered

Related Article

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.