在PB中如何调用只有output参数的ORACLE函数
ltwy 2004-02-26 01:15:21 我在ORACLE下写的函数如下:
create or replace function P_GET_PZXH(avc_xhz out varchar2)
return number is
begin
...
avc_xhz := ...;
return 100;
exception
when others then
avc_xhz := 'ERROR';
return -100;
end;
我在PB里的写法(1):
int li_ret
string is_pzxh
DECLARE tmp_pzxh procedure FOR
P_GET_PZXH(avc_xhz =:is_pzxh);
execute tmp_pzxh;
if SQLCA.sqlcode<>0 then
messagebox('错误','失败!'+SQLCA.SQLErrText)
return 0
end if
fetch tmp_pzxh into :li_ret,:is_pzxh;
close tmp_pzxh;
错误提示:
ORA-06550: line 1, column 29:
PLS-00201: identifier 'AVC_XHZ' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
写法(2):
declare p_1 dynamic procedure for sqlsa;
prepare sqlsa from "execute P_GET_PZXH @avc_xhz =?";
execute dynamic p_1 using :is_pzxh;
fetch p_1 into :is_pzxh;
错误提示:
ORA-06550: line 1, column 15:
PLS-00306: wrong number or types of arguments in call to 'P_GET_WSPZXH'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
请各位大侠帮我诊断诊断,到底哪出了问题?