发布网友 发布时间:2022-04-26 20:42
共3个回答
热心网友 时间:2022-04-08 00:29
触发器的语法
create
[or
replace]
trigger
trigger_name
{before
|
after
}
{insert
|
delete
|
update
[of
column
[,
column
…]]}
[or
{insert
|
delete
|
update
[of
column
[,
column
…]]}...]
on
[schema.]table_name
|
[schema.]view_name
[referencing
{old
[as]
old
|
new
[as]
new|
parent
as
parent}]
[for
each
row
]
[when
condition]
update后面可以跟
of
column,column.....
on
tablename
把需要触发的字段写上,不触发的就别写了
热心网友 时间:2022-04-08 01:47
CREATE OR REPLACE TRIGGER 触发器名称
AFTER
INSERT OR UPDATE of name,pwd
ON road_status
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
IF INSERTING
THEN
执行语句;
ELSIF UPDATING
THEN
执行语句;
END IF;
END;
热心网友 时间:2022-04-08 03:22
create or replace trigger t_test
after insert or update on 表名
for each row
begin
insert into 新表 (name,password) values (:NEW.name,:NEW.password);
end t_test;