Trigger 1 (learning notes)

Source: Internet
Author: User

Syntax:

Create [or replace] trigger trigger_name: Create a trigger and set the trigger name. If or replace is selected, the trigger is replaced if it already exists.

[Befor | after]: refers to the trigger day, beforc between operations, after the operation is triggered

Instead of: Used to replace a trigger. The trigger type defined for view operations

Insert | update of column name | Delete, triggering event, which can be insert, update, delete, or partially update added to a data table

On [Table Name | View | database | schema]: refers to the trigger object of a trigger. It can be a table, view, database, or mode (user)

Referencing [old as Mark] [new as Mark] [parent as Mark]: defines aliases for ": Old", ": New", ": parent"

[For each row]: defines a row-Level Trigger. If this parameter is not specified, a table-Level Trigger is defined.

[Follows trigger name:] configure the execution sequence of multiple triggers

[Disable:] A trigger is enabled by default after it is created. You can use this option to disable it.

[When trigger condition]: triggers are executed when the specified condition is met.

[Declare]: The subject declaration part of the trigger, which defines variables or cursors.

[Pragma autonomous_transaction;] autonomous transaction statement

Begin: Main part of the program

End: the end tag of the trigger.

 

The trigger does not receive any listening parameters, and is automatically called only after a trigger event is generated.

 

Trigger 1 (learning notes)

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.