我想可以用after update for each row.
解决方案 »
- oracle服务不能正常启动?
- 新手求教:ORA-01422: 实际返回的行数超出请求的行数
- JDBC连接池偶尔"Io 异常: The Network Adapter could not establish the connection"
- 想问一下oracleparallel工作的原理
- 求一SQL语句
- 从Header和line表读数据输出到文本文件,要求1行header数据,多行line数据,求怎么处理
- 这段sql怎么写? 要用排序,统计。
- 关于Oracle的多对多查询的问题,谢谢。
- Net Assistant 不能正常运行问题
- sqlldr命令中怎样放置.ctl文件的路径?
- 请问数据冗余到底是什么意思啊(一个才鸟)
- 问一个非技术的问题,怎样做好一个项目经理!
BEFORE UPDATE OF isfin
ON a
FOR EACH ROW
BEGIN
IF :new.isfin = 1 and :old.isfin = 0 THEN
insert into e select c.user_code,c.isinu,d.fin_time,sysdate from c,d where c.f_code = :new.f_code and c.f_ins = :new.f_ins and d.f_code = :new.f_code and d.f_ins = :new.f_ins;
END IF;
END demotr;
/
你试试行不行
AFTER UPDATE OF isfin
ON a
FOR EACH ROW
BEGIN
IF :new.isfin = 1 and :old.isfin = 0 THEN
insert into e select c.user_code,c.IsInU,d.fin_time,sysdate from c,d where c.f_code = :old.f_code and c.f_ins = :old.f_ins and d.f_code = :old.f_code and d.f_ins = :old.f_ins;
END IF;
END yourtrgname;
这里不知道Scrate对于关联字段的修改时怎么处理,所以我觉得是否用:old比较好。
^o^
after update on a
for each row
declare
c_user_code c.user_code%type;
c_IsInU c.IsInU%type;
d_fin_time d.fin_time%type;
begin
if :new.IsFin=1 and :old.IsFin=0
then
/*根据a表的f_code和f_ins字段,把c表的相应记录的user_code,IsInU字段和d表中相应记录的fin_time字段,记录到对应的变量中去。*/
insert into e values(c_user_code,c_IsInU,d_fin_time,sysdate);
end if;
end;
insert into 表名 (列名) values(值)
如果写成这样,values中的值怎么写呀
declare
usercode NUMBER(10);
begin
select user_code
into usercode
from r_accept_task_13
where r_accept_task_13.node_code = :new.node_code
and r_accept_task_13.flow_code = :new.flow_code;
insert into sh_message(user_code,isfinish,exp_time,flow_name,n_time) values('usercode','0','30','超期请求',sysdate);
end;