Trigger problems in Oracle Database (1)

Source: Internet
Author: User

TriggerIs a special type of stored procedure, which is different from the stored procedure. A trigger is executed when an event is triggered. trigger events can be divided into three categories: DML events, DDL events, and database events, stored procedures can be called directly by the stored procedure name. When performing operations such as UPDATE, INSERT, and DELETE on a table, SQL Server automatically runs the SQL statement defined by the trigger, this ensures that data processing must comply with the rules defined by these SQL statements. The following describes the problems with triggers in oracle databases.

A trigger is a code block automatically executed when a specific event occurs. It is similar to a stored procedure, but users cannot directly call them.

Trigger Function

1. Allow/restrict table modifications

2. automatically generate a derived column, such as an auto-increment Field

3. Forced Data Consistency

4. provide audit and logging

5. Prevent invalid transaction processing

6. Enable complex business logic

Trigger type

There are four types of triggers:

Data manipulation language (DML) triggers: DML triggers are defined on tables and created on tables. When writing a DML trigger, a trigger triggered by a DML event has two elements: 1. Determine the trigger table, that is, the table on which the trigger is defined. 2. determine the trigger event. The DML trigger event includes INSERT, UPDATE, and DELETE. The trigger is replaced by the instead of trigger, which is created on the view, it is used to replace the delete, insert, and modify operations on the view. The Data Definition Language (DDL) Trigger, referred to as the DDL trigger, is defined in the mode. The trigger event is the creation and modification of the data object; database event triggers are defined in the entire database or mode. A trigger event is a database event.


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.