先试一下,看有没有值? select count(*) from ord_attemper where attemper='d080304012' and trim(item_code)='24320400011901883';
实际上数据库中时存在记录的,也就是第一条语句不会找不到记录: ====================================== SQL> select location from ord_attemper_head 2 where (location is not null) 3 and attemper='d080304012' 4 and cause_code='z080' and rownum=1;LOCATION ---------- d005
SQL> select count(*) from ord_attemper 2 where attemper='d080304012' 3 and trim(item_code)='24320400011901883'; COUNT(*) ---------- 1
select location into plocation from ord_attemper_head where (location is not null) and attemper=:new.attemper and cause_code=:new.cause_code and rownum=1;delete触发器应该用:old,而不是:new两个名字是一个人吗?
先删除ord_attemper_head表中的此条记录后,再试试删除主表中的那条记录。
cause_code=:new.cause_code and rownum=1; ??? 这么简单!! 气死我了。我检查了一边这个问题 发现下面的都没错 唯独没发现这个!!
select count(*) from ord_attemper where attemper='d080304012' and trim(item_code)='24320400011901883';
======================================
SQL> select location from ord_attemper_head
2 where (location is not null)
3 and attemper='d080304012'
4 and cause_code='z080' and rownum=1;LOCATION
----------
d005
2 where attemper='d080304012'
3 and trim(item_code)='24320400011901883'; COUNT(*)
----------
1
where (location is not null) and attemper=:new.attemper and cause_code=:new.cause_code and rownum=1;delete触发器应该用:old,而不是:new两个名字是一个人吗?
???
这么简单!!
气死我了。我检查了一边这个问题
发现下面的都没错
唯独没发现这个!!