0
这是我第一个问题,我在这里是新的,所以我希望我在正确的主题问好...等 我试着用触发器从一个表中捕获信息,比较来自该表的一些数据,并且如果条件为真,那么触发器必须存储改变一些值的信息。有我的表和触发器。我需要这个触发器来存储更大的表格,并且有很多列和更多的信息,但这只是一个测试,请帮助! :'(PL/SQL触发器格式信息编译错误
create table datos_prueba(
nombre varchar2(10) primary key,
numero number(3),
mensaje varchar(30),
fecha date);
create table store_datos_prueba(
nombre varchar(20) primary key,
numero number(5),
mensaje varchar(30),
fecha date);
这是扳机,我又写道,但它是错的......
create or replace trigger tgr_trigger_prueba
after insert on datos_prueba
for each row
declare
cambio_numero number;
begin
if :datos_prueba.numero <= 5 then
insert into store_datos_prueba (nombre,numero,mensaje,fecha) values(:datos_prueba.nombre,666,:datos_prueba.mensaje,:datos_prueba.fecha);
else
insert into store_datos_prueba (nombre,numero,mensaje,fecha) values(:datos_prueba.nombre,777,:datos_prueba.mensaje,:datos_prueba.fecha);
end if;
end;
':old'将为插入返回NULL。我认为你的意思是':新'。 – 2014-11-25 01:40:13
@ maheswaran-revisankar酷男!非常感谢你,它完美的工作:) – 2014-11-25 16:10:59