--业务需求,通过触发器在新增时将姓名开始含有”T"英文的status状态改为1 --1.创建表create table test_user (id number,name nvarchar2(10),status number);insert into test_user values(1,'Hong',0);insert into test_user values(2,'Qiang',0);commit;select * from test_user; --2.创建触发器create or replace trigger test_user_updatestatus before insert on test_userfor each row begin if :new.name like 'T%' then :new.status:=1; end if; end; --3.测试插入数据 insert into test_user values(3,'Tom',0); insert into test_user values(4,'jition',888); insert into test_user values(5,'tom',0); insert into test_user values(6,'Tian',888); commit; select * from test_user