Home > Database > Mysql Tutorial > Detailed introduction to UPDATE trigger

Detailed introduction to UPDATE trigger

巴扎黑
Release: 2017-06-10 16:41:51
Original
4545 people have browsed it

UPDATE trigger The UPDATE trigger executes before or after the UPDATE statement is executed. You need to know the following points: 1. In the UPDATE trigger code, you can reference a virtual table named OLD to access the previous value (before the UPDATE statement), and reference a virtual table named NEW to access the newly updated value; 2 .In the BEFORE UPDATE trigger, the value in NEW may also be updated (allowing changes to the value to be used in the UPDATE statement); 3. The values ​​in OLD are all read-only and cannot be updated. The following example ensures that state abbreviations are always uppercase (regardless of whether uppercase or lowercase is given in the UPDATE statement): Input: create trigger updatevendor before update on vends for each row set new.vend_state =&n

1. MySQL UPDATE trigger (update) and trigger in-depth analysis

Detailed introduction to UPDATE trigger

##Introduction: UPDATE trigger UPDATE trigger executes before or after the UPDATE statement is executed. You need to know the following points: 1. In the UPDATE trigger code, you can reference a virtual table named OLD to access the previous (before UPDATE statement) value, and reference a virtual table named NEW to access the newly updated value; 2 .In a BEFORE UPDATE trigger, the value in NEW may also be updated (allowing changes to the value to be used in the UPDATE statement);

2. SQL Server triggers When a specific field of the table is updated, the Update trigger is triggered

#Introduction: In addition, one more sentence: insert and update data will be saved in the temporary table, so it can be taken out using inserted When deleting these data, you can use deleted to retrieve the deleted data

3. Method of updating this table in Oralce trigger

Detailed introduction to UPDATE trigger

#Introduction: How to update this table in Oralce trigger. This article talks about two issues: 1. The difference between update trigger before and after. 2. After a certain field in table A is updated, the trigger triggers

4. Oracle manual refresh materialized view problem

Introduction: A recent project requires manual refresh of a materialized view after the document is successfully submitted. The initial plan was to call dbms_refresh.refresh(

5. MySQL5.7 supports multiple INSERT/DELETE/UPDATE triggers in a table

Detailed introduction to UPDATE trigger

Introduction: In version MySQL 5.6, multiple INSERT/DELETE/UPDATE triggers for a table are not supported. For example, create two INSERT triggers in table t1: DELIMITER$$USE`test`$$DROPTRIGGER/*!50032IFEXISTS*/`t.

[Related Q&A recommendations]:

java - What’s wrong with this mysql update trigger?

The above is the detailed content of Detailed introduction to UPDATE trigger. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template