2,497
社区成员
发帖
与我相关
我的任务
分享
sp1.Close;
sp1.Parameters.Clear;
sp1 := TADOStoredProc.Create(nil);
sp1.Connection:= con1;
sp1.ProcedureName:='testdel';//'HS_OTC.TESTDEL';
sp1.Parameters.Clear;
sp1.Parameters.Refresh;
sp1.Parameters.CreateParameter('otc_account', ftString, pdInput, 32, fgUnassigned); //传入参数
sp1.Parameters.CreateParameter('error_no', ftInteger, pdoutput, 10, fgUnassigned); //返回值
sp1.Parameters[0].Value := '13';
sp1.Parameters[1].Value := 11;
try
//sp1.open;
sp1.ExecProc;
except
on E: Exception do
begin
Application.MessageBox(PChar('连接ORACLE失败!原因:' + E.message), '系统错误', MB_OK+MB_ICONERROR);
Exit;
end;
end;
result_t :=sp1.Parameters.ParamByName('error_no').Value;
sp1.Close;
/****************************************************************************************************/
/* 名 称: TESTDEL */
/* 功 能: */
/* 功 能 编 号: */
/* 返 回: */
/* 调用函数或过程: */
/* */
/****************************************************************************************************/
prompt create function 'hs_otc.TESTDEL' ...
create or replace function hs_otc.TESTDEL
(
p_otc_account hstype.HsOtcAccount%type ,--商品账号
p_error_no out hstype.HsNumID%type --错误代码
)
return number
as
v_error_info hstype.HsChar500%type; --错误提示
v_error_id hstype.HsNumID%type; --错误序号
v_error_sysinfo hstype.HsChar500%type; --系统错误信息
v_error_pathinfo hstype.HsChar500%type; --错误路径信息
v_error_pathinfo_tmp hstype.HsChar500%type; --错误路径临时变量
begin
p_error_no := 0;
v_error_info := ' ';
v_error_id := 0;
v_error_sysinfo := ' ';
v_error_pathinfo := ' ';
v_error_pathinfo := substr(v_error_pathinfo || '-->TESTDEL',1,500);
v_error_pathinfo_tmp := v_error_pathinfo;
-- 事务处理开始
begin
delete/*TESTDEL*/ from otcholderctrl where trim(client_id)='';
end;
-- begin
-- select count(*) into @count from otcholderctrl;
-- end;
commit;
return(0);
exception
when others then
rollback;
p_error_no := 101;
v_error_info :='执行存储过程错误'||'TESTDEL';
v_error_id := SQLCODE;
v_error_sysinfo := SQLERRM;
return(p_error_no);
end TESTDEL;
/
begin
DELETE hs_otc.hsobjects WHERE object_name = 'TESTDEL' AND object_type = 'P';
INSERT into hs_otc.hsobjects (
object_id, object_name, own_base, object_type,
master_ver, second_ver, third_ver, build_ver)
values (
3284004, 'TESTDEL','OTCDB', 'P',
8, 5, 2, 0);
end;
/
begin
commit;
end;
/