create or replace procedure pr_klfx(dw in varchar, y in int, m in int) is
i number;
j number;
mny number;
BEGIN
DELETE IA_KLFX IA WHERE IA.PK_CORP=dw and ia.caccountyear=y and ia.caccountmonth=m;在执行存储过程时,始终不执行delete语句,请求各路大神帮忙。在线等存储delete
i number;
j number;
mny number;
BEGIN
DELETE IA_KLFX IA WHERE IA.PK_CORP=dw and ia.caccountyear=y and ia.caccountmonth=m;在执行存储过程时,始终不执行delete语句,请求各路大神帮忙。在线等存储delete
i number;
j number;
mny number;
BEGIN
select count(1)
into i
from IA_KLFX IA
WHERE IA.PK_CORP = dw
and ia.caccountyear = y
and ia.caccountmonth = m;
dbms_output.put_line(i);
end;运行下,看什么结果
另外看看有没有发生锁等等
declare
cout number;
begin
select count(1) into cout from t_system_usermodel s where s.modelid=(select m.id from t_districtmodule m where m.modulename='学生基本情况统计(省资助)' and m.supmodule=(select id from t_districtmodule where modulename='中小学资助统计' and supmodule=(select id from t_districtmodule where modulename='查询统计' and supmodule is null))) and s.columnid=1 and s.type=1;
if cout>0 then
execute immediate 'delete from t_system_usermodel s where s.modelid=(select m.id from t_districtmodule m where m.modulename=''学生基本情况统计(省资助)'' and m.supmodule=(select id from t_districtmodule where modulename=''中小学资助统计'' and supmodule=(select id from t_districtmodule where modulename=''查询统计'' and supmodule is null))) and s.columnid=1 and s.type=1';
commit;
end if;
end;
/
删除语句要放在execute immediate '';里面执行,试试吧
你是怎么执行存储过程的,,pl/SQL,toad??delete语句看起来没啥问题,你的没执行 是啥意思,报错还是没删掉数据?要是没删掉数据,你先看表里面有没有符合条件的数据啊。
i := sql%rowcount;
dbms_output.put_line(i);
commit;
看看i是什么值