你好!请问我用代码创建调用存储过程,总是报[Parameter '@as_BATCHID' not found]
我的存储过程是:
create or replace procedure clnslc(as_BATCHID in string,
as_msg out string,
as_lcbh out string) is
t_num integer;
begin
as_msg := '';
for rec in (select * from oa_cardregsub a where a.batchid = as_BATCHID) loop
begin
select count(1)
into t_num
from oa_cardregsub
where oa_cardregsub.pzhm = rec.pzhm
and oa_cardregsub.nsbz not in ('0', '3');
if t_num > 0 then
begin
as_msg := '对不起,[' || rec.pzhm || ']已经提交年审,不能进行其他变更操作!';
as_lcbh := rec.regcardid;
end;
end if;
end;
end loop;
end clnslc;
调用的代码:
var
as_BATCHID,as_msg,as_lcbh:string;
storedproc :TStoredProc;
begin
inherited; storedproc.ConnectionString :='DATABASEURL=Biz:\OAXT\OACCGCBSJK.Database';
storedproc.StoredProcName :='CLNSLC';
storedproc.Params.ParamByName('@as_BATCHID').AsString :=as_BATCHID;
// vProc.Params.ParamByName('@DepId').AsString := vDepId;
storedproc.Execute;
as_msg:=storedproc.params[1].AsString;
as_lcbh:=storedproc.params[2].AsString;
finally
storedproc.Free;
end;
if as_msg <>'' then
begin
Command.Accept:=false;
jsdialogs.ShowMsg(as_msg,'重要提示');
end;
end; |