create or replace trigger trg_i_bdz_xlmc2003
after insert
on line_hour_xs2003
for each row
declare
bdzmc varchar2(30);
xlmc varchar2(30);
begin
bdzmc := :new.bdzmc;
xlmc := :new.xlmc;
if (bdzmc!="" and xlmc!="") then
begin
if (select count(*) from bdz_xlmc2003 where bdzmc=bdzmc and xlmc=xlmc)=0 then
begin
insert into bdz_xlmc2003 values (bdzmc,xlmc) ;
commit;
exception when others then
rollback;
dbms_output.put_line("Invalid inserted");
end;
end if;
end;
end if;
end;
该触发器运行时报错,if (select count(*) from bdz_xlmc2003 where bdzmc=bdzmc and xlmc=xlmc)=0 then...报在这个地方,好像没有什么错吧。
请高手指点~~~
after insert
on line_hour_xs2003
for each row
declare
bdzmc varchar2(30);
xlmc varchar2(30);
begin
bdzmc := :new.bdzmc;
xlmc := :new.xlmc;
if (bdzmc!="" and xlmc!="") then
begin
if (select count(*) from bdz_xlmc2003 where bdzmc=bdzmc and xlmc=xlmc)=0 then
begin
insert into bdz_xlmc2003 values (bdzmc,xlmc) ;
commit;
exception when others then
rollback;
dbms_output.put_line("Invalid inserted");
end;
end if;
end;
end if;
end;
该触发器运行时报错,if (select count(*) from bdz_xlmc2003 where bdzmc=bdzmc and xlmc=xlmc)=0 then...报在这个地方,好像没有什么错吧。
请高手指点~~~
解决方案 »
- SQL语句写入存贮过程,缺插入不了数据,帮忙看看什么原因?
- 急!误删Oracle9i的数据表,没有备份数据,怎样恢复?
- oracle 通配符问题,急!急!急!急!
- -----------在java中执行SQL的问题,奇怪的ora-01843: not a valid month,100分求助《急》《急》-------------
- 有关查询条件的问题
- 问一个关于在oracle9i的sql plus和Enterprise Manager Console中登录的问题.
- 转换字符字段的问题?
- 散分:请问oracle中怎么设table description和field description? 在线等待,谢谢
- 如何解决Oracle 9i 无法找到DCE32.dll动态链接库的错误?
- 工作中遇到的困难,高手指点,谢谢
- 求一存储过程(sqlserver转oracle)
- sybase触发器转成oracle~~大家帮忙~
if (select ...)=0不能这样写,那应该怎么写呀?
按照你说的,已经改好啦,编译也通过啦~~
结贴给分啦!