create or replace TRIGGER FORMSON_0021_I
before INSERT ON seeyon.formson_0021
for each row
declare
F_ID NUMBER(19,0) :=0;
f_id_10 decimal(20,2);
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
IF INSERTING THEN
select id into F_ID from formson_0021 where sort=:new.sort-1 and FORMMAIN_ID=:new.FORMMAIN_ID;
IF F_ID > 0 THEN
select field0010 into f_id_10 from formson_0021 where id =F_ID;
IF :new.field0009 is not null THEN
:new.FIELD0010 :=f_id_10+:new.field0009;
END IF;
IF :new.field0013 is not null THEN
:new.FIELD0010 :=f_id_10-:new.field0013;
END IF;
END IF;
END IF;
COMMIT;
END;
before INSERT ON seeyon.formson_0021
for each row
declare
F_ID NUMBER(19,0) :=0;
f_id_10 decimal(20,2);
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
IF INSERTING THEN
select id into F_ID from formson_0021 where sort=:new.sort-1 and FORMMAIN_ID=:new.FORMMAIN_ID;
IF F_ID > 0 THEN
select field0010 into f_id_10 from formson_0021 where id =F_ID;
IF :new.field0009 is not null THEN
:new.FIELD0010 :=f_id_10+:new.field0009;
END IF;
IF :new.field0013 is not null THEN
:new.FIELD0010 :=f_id_10-:new.field0013;
END IF;
END IF;
END IF;
COMMIT;
END;
解决方案 »
- 很奇怪的Oracle资源正忙,要求指定NOWAIT问题
- SQL优化 在线等!!
- 3个字段group by,去掉统计<200的分组,然后再统计的sql语句的问题!
- 超难问题.关于datalink的安全问题。在线!解决立即给分
- Select 语句中怎么提取记录的索引值(RowNum)?
- ORACLE初学,建库问题...
- oracle9i在windows server 2000上 在往表中加入汉字时,应用后输入汉字的字段出现乱吗?
- Oracle advanced replication问题?
- 关于pl/sql查询语句编写的问题
- Oracle,创建一个存储过程,获取打印每个职工最新的一条变更信息。
- 搭建数仓抽取数据过程中,kettle提示表空间不足,请问怎么解决?中途停止建立的数据文件,offline drop后并手动删除了dbf文件后会有什么影响?
- ogg的mgr进程
insert into tab1(.., .., ..)
select .., .., (select 余额 from tab1 where ......) from dual;