create or replace package body dealingchk_pac is
function itemchk(p_itemno n_3ditemb.item_no%type default null,
p_type n_3ditemb.type%type default null,
p_symbol n_3ditembrec.trade_symbol%type default null,
p_code n_3duser.code%type default null,
p_sttime n_3ditembrec.time%type default null,
p_endtime n_3ditembrec.time%type default null)
return chk_rec
is
v_itemno n_3ditemb.item_no%type:=null;
v_type n_3ditemb.type%type:=null;
v_symbol n_3ditembrec.trade_symbol%type:=null;
v_code n_3duser.code%type:=null;
v_time n_3ditembrec.time%type:=null;
begin
if p_itemno is not null then
v_itemno:=' and b.item_no='||p_itemno;
end if;
if p_type is not null then
v_type:=' and b.type='||p_type;
end if;
if p_symbol is not null then
v_symbol:=' and a.trade_symbol='||p_symbol;
end if;
if p_code is not null then
v_code:=' and c.code='||p_code;
end if;
if (p_sttime is not null and p_endtime is not null) then
v_time:=' and a.time between '||p_sttime||' and '||p_endtime;
end if;
execute immediate 'SELECT b.item_no,b.type,a.trade_symbol,c.code,a.time
FROM n_3ditemarec a, n_3ditema b, n_3duser c
WHERE a.item_id = b.id AND a.user3d_id = c.id'||
v_itemno||v_type||v_symbol||
v_code||v_time
bulk collect into chk_table;
return chk_table;
end itemchk;
end dealingchk_pac;
错误是itemchk在包头中有声明,必须在包体中定义。可我明明定义了itemchk啊
[本帖最后由 cargoj 于 2009-5-7 12:01 编辑]