oracle 包体编译不了,写了一个包体编译有错误,不知道哪里错了

这篇博客讲述了在尝试编译Oracle包体时遇到的问题,即包体中定义的函数itemchk在编译时提示已在包头声明,需要在包体中定义。博主展示了包体的代码,并表示已明确在包体中定义了该函数,但仍然收到错误信息。文章末尾,博主表达了寻求解决方法的需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 编辑]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值