包体中出现PLS-00323错误,程序名称正确

时间:2013-01-19 19:37:32

标签: debugging plsql procedure

以下代码在两个地方收到错误PLS-00323。第一个位置是spt_save_casedetail过程,它表示“子程序或游标'spt_save_casedetail'在包规范中声明,必须在包体中定义”。这是代码(警告它很久):

create or replace
package body ct_cu_act_um1_pg
is

procedure spt_save_casedetail (
p_primarymemberplanid_in      in casedetail.primarymemberplanid%type,
p_servicetypecd_in            in casedetail.servicetypecd%type,
p_notifydt_in                 in casedetail.notifydt%type,
p_assignedentityid_in         in casedetail.assignedentityid%type,
p_startdt_in                  in casedetail.startdt%type,
p_enddt_in                    in casedetail.enddt%type,
p_caretypemnemonic_in         in casedetail.caretypemnemonic%type,
p_casestatusmnemonic_in       in casedetail.casestatusmnemonic%type,
p_odsorderingproviderid_in    in casedetail.odsorderingproviderid%type,
p_sourcemnemonic_in           in casedetail.sourcemnemonic%type,
p_caseresolutionmnemonic_in   in casedetail.caseresolutionmnemonic%type,
p_odsservicingproviderid_in   in casedetail.odsservicingproviderid%type,
p_serviceitemmnemonic_in      in casedetail.serviceitemmnemonic%type,
p_providerinnetworkind_in     in casedetail.providerinnetworkind%type,
p_detailtxt_in                in casedetail.detailtxt%type,
p_odsfacilityvendorid_in      in casedetail.odsfacilityvendorid%type,
p_servicelocationcd_in        in casedetail.servicelocationcd%type,
p_facilityinnetworkind_in     in casedetail.facilityinnetworkind%type,
p_audit_user_in               in casedetail.updatedby%type,
p_return_cur_out              out sys_refcursor,
p_err_code_out                out number,
p_err_mesg_out                out varchar2)
is
v_casedetailid                casedetail.casedetailid%type;
begin
select casedetail_seq.nextval into v_casedetailid from dual;
if v_casedetailid is null
  then
    insert into casedetail
      (casedetailid,
       primarymemberplanid,
       servicetypecd,
       notifydt,
       assignedentityid,
       startdt,
       enddt,
       caretypemnemonic,
       casestatusmnemonic,
       odsorderingproviderid,
       sourcemnemonic,
       caseresolutionmnemonic,
       odsservicingproviderid,
       serviceitemmnemonic,
       providerinnetworkind,
       detailtxt,
       odsfacilityvendorid,
       servicelocationcd,
       facilityinnetworkind)
    values
      (casedetail_seq.nextval,
       p_primarymemberplanid_in,
       p_servicetypecd_in,
       p_notifydt_in,
       p_assignedentityid_in,
       p_startdt_in,
       p_enddt_in,
       p_caretypemnemonic_in,
       p_casestatusmnemonic_in,
       p_odsorderingproviderid_in,
       p_sourcemnemonic_in,
       p_caseresolutionmnemonic_in,
       p_odsservicingproviderid_in,
       p_serviceitemmnemonic_in,
       p_providerinnetworkind_in,
       p_detailtxt_in,
       p_odsfacilityvendorid_in,
       p_servicelocationcd_in,
       p_facilityinnetworkind_in);

    open p_return_cur_out for
      select casedetail_seq.currval
      from dual;
  else
    update casedetail
      set primarymemberplanid = p_primarymemberplanid_in,
          servicetypecd = p_servicetypecd_in,
          notifydt = p_notifydt_in,
          assignedentityid = p_assignedentityid_in,
          startdt = p_startdt_in,
          enddt = p_enddt_in,
          caretypemnemonic = p_caretypemnemonic_in,
          casestatusmnemonic = p_casestatusmnemonic_in,
          odsorderingproviderid = p_odsorderingproviderid_in,
          sourcemnemonic = p_sourcemnemonic_in,
          caseresolutionmnemonic = p_caseresolutionmnemonic_in,
          odsservicingproviderid = p_odsservicingproviderid_in,
          serviceitemmnemonic = p_serviceitemmnemonic_in,
          providerinnetworkind = p_providerinnetworkind_in,
          detailtxt = p_detailtxt_in,
          odsfacilityvendorid = p_odsfacilityvendorid_in,
          servicelocationcd = p_servicelocationcd_in,
          facilityinnetworkind = p_facilityinnetworkind_in,
          updateddt = systimestamp,
          updatedby = p_audit_user_in
      where casedetailid = v_casedetailid;

    open p_return_cur_out for
      select casedetail_seq.currval
      from dual;
end if;

p_err_code_out := 0;
exception
when others then
  p_err_code_out := -1;
  p_err_mesg_out := 'error in ct_cu_act_um1_pg.spt_save_casedetail =>'|| sqlerrm;
end spt_save_casedetail;

这是包规范:

create or replace
package ct_cu_act_um1_pg
is

  procedure spt_save_casedetail (
p_primarymemberplanid_in      in casedetail.primarymemberplanid%type,
p_servicetypecd_in            in casedetail.servicetypecd%type,
p_notifydt_in                 in casedetail.notifydt%type,
p_assignedentityid_in         in casedetail.assignedentityid%type,
p_startdt_in                  in casedetail.startdt%type,
p_enddt_in                    in casedetail.enddt%type,
p_caretypemnemonic_in         in casedetail.caretypemnemonic%type,
p_casestatusmnemonic_in       in casedetail.casestatusmnemonic%type,
p_odsorderingproviderid_in    in casedetail.odsorderingproviderid%type,
p_sourcemnemonic_in           in casedetail.sourcemnemonic%type,
p_caseresolutionmnemonic_in   in casedetail.caseresolutionmnemonic%type,
p_odsservicingproviderid_in   in casedetail.odsservicingproviderid%type,
p_serviceitemmnemonic_in      in casedetail.serviceitemmnemonic%type,
p_providerinnetworkind_in     in casedetail.providerinnetworkind%type,
p_detailtxt_in                in casedetail.detailtxt%type,
p_odsfacilityvendorid_in      in casedetail.odsfacilityvendorid%type,
p_servicelocationcd_in        in casedetail.servicelocationcd%type,
p_facilityinnetworkind_in     in casedetail.facilityinnetworkind%type,
p_return_cur_out              out sys_refcursor,
p_err_code_out                out number,
p_err_mesg_out                out varchar2
  );

我得到相同错误的第二个地方是我定义v_casedetailid的地方。我检查确保一切拼写正确,但也许我错过了一些东西,因为我已经看了一段时间。感谢任何帮助。谢谢。

1 个答案:

答案 0 :(得分:3)

您的程序规范和正文声明不匹配。

body:
p_facilityinnetworkind_in     in casedetail.facilityinnetworkind%type,
**p_audit_user_in               in casedetail.updatedby%type,**
p_return_cur_out              out sys_refcursor,
p_err_code_out                out number,
p_err_mesg_out                out varchar2)

spec:
**p_facilityinnetworkind_in     in casedetail.facilityinnetworkind%type,**
p_return_cur_out              out sys_refcursor,
p_err_code_out                out number,
p_err_mesg_out                out varchar2
  );