急,存储过程出现ORA-06550错误,请高手帮忙看看是什么问题?先谢了
错误提示:
ORA-06550: 第 1 行, 第 7 列: PLS-00905: object OADEV.SP_OA_ORGCANCEL is invalid ORA-06550: 第 1 行, 第 7 列: PL/SQL: Statement ignored
create or replace procedure sp_OA_OrgCancel(
o_Ret out number,
o_RetInfo out varchar2,
i_OrgID in int,--撤消组织
i_CancelDate in date --撤消时间
)
AS
v_id int;
v_FCancelDate date;
cursor cs_org is select id,FCancelDate from lborganization where instr('.'||fdncode||'.'||id||'.','.'||i_OrgID||'.')>0;
v_Check int;
BEGIN
o_Ret:=1;
o_RetInfo:='';
--合法性判断
select count(1) into v_Check from lborganization where id in (select fid from lborganization where id=i_OrgID) and FCancelDate<i_CancelDate and FCancelDate is not null;
if v_Check>0 then
o_Ret:=-1;
o_RetInfo:='撤消日期不能晚于父对象撤消日期';
return;
end if;
select count(1) into v_Check from lborganization where instr('.'||fdncode||'.','.'||i_OrgID||'.')>0 and FCancelDate>i_CancelDate;
if v_Check>0 then
o_Ret:=-1;
o_RetInfo:='撤消日期不能早于子对象撤消时间';
return;
end if;
open cs_org;
fetch cs_org into v_id,v_FCancelDate;
while cs_org%found loop
if v_FCancelDate is null then
--存在撤消时间说明是已经撤消的记录,不修改撤消时间,避免数据不一致
update lborganization set FCancelDate=i_CancelDate where id=v_id;
--撤消岗位
update HRM_PostInfo set FCancelDate=i_CancelDate where fdept=v_id and (FCancelDate>i_CancelDate or FCancelDate is null);
end if;
fetch cs_org into v_id,v_FCancelDate;
end loop;
close cs_org;
END;