数据仓库服务 GAUSSDB(DWS)-CREATE TRIGGER:语法格式

时间:2024-12-06 15:12:42

语法格式

1
2
3
4
5
6
7
CREATE [ CONSTRAINT ] TRIGGER trigger_name { BEFORE | AFTER | INSTEAD OF } { event [ OR ... ] }
    ON table_name
    [ FROM referenced_table_name ]
    { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }
    [ FOR [ EACH ] { ROW | STATEMENT } ]
    [ WHEN ( condition ) ]
    EXECUTE PROCEDURE function_name ( arguments );

其中event包含以下几种:

1
2
3
4
    INSERT
    UPDATE [ OF column_name [, ... ] ]
    DELETE
    TRUNCATE
support.huaweicloud.com/sqlreference-910-dws/dws_06_0184.html