原因:由于ORA-06550导致FDPSTP失败:第1行第7列:PLS-00221:不是程序或未定义

时间:2012-08-03 19:27:02

标签: oracle plsql

我正在尝试在APPS中运行并发请求,但我一直收到此错误

(Cause: FDPSTP failed due to ORA-06550: line 1, column 7:
PLS-00221: 'XXINV_ITEM_ORACLE_E5B0' is not a procedure or is undefined
ORA-06550: line 1, column 7:  
PL/SQL: Statement ignored)

并且我的包裹身体只是一个简单的插入物。

CREATE OR REPLACE PACKAGE BODY  APPS.XXINV_ITEM_ORACLE_E5B0 IS
PROCEDURE  inv_com_proc (
      o_chr_errbuf     OUT      VARCHAR2,
      o_num_retcode    OUT      NUMBER
  )
AS
  begin
  EXECUTE IMMEDIATE 'TRUNCATE TABLE  XXINV.XXINV_ITEM_ORACLE_E5B0';
  Insert into XXINV.XXINV_ITEM_ORACLE_E5B0(ORGANIZATION_CODE ,
  ITEM_NUM, 
  ON_HAND_QUANTITY ,
  ITEM_TYPE ,
  STATUS ,
  MATERIAL_COST ,
  MATERIAL_OVERHEAD_COST,
  RESOURCE_COST,
  OVERHEAD_COST,
  OUTSIDE_PROCESSING_COST,
  SUBINVENTORY_CODE ,
  LOCATORS )
  select OWNING_ORG_CODE, ITEM_NUMBER, ON_HAND_QUANTITY, ITEM_TYPE, STATUS, MATERIAL_COST ,
  MATERIAL_OVERHEAD_COST,
  RESOURCE_COST,
  OVERHEAD_COST,
  OUTSIDE_PROCESSING_COST,
  SUBINVENTORY_CODE ,
  LOCATOR
  from apps.XXRPT_INV_VALUATION_D535_V
  where apps.XXRPT_INV_VALUATION_D535_V.SUBINVENTORY_CODE = 'FG' AND apps.XXRPT_INV_VALUATION_D535_V.STATUS = 'ONHAND';
  COMMIT;
  END;

end XXINV_ITEM_ORACLE_E5B0;

2 个答案:

答案 0 :(得分:2)

在系统管理中定义并发程序可执行文件时,请确保执行文件名包含schema.package.procedure,如APPS.XXINV_ITEM_ORACLE_E5B0.inv_com_proc(无括号)。

答案 1 :(得分:1)

看起来你正试图执行包本身 - 这是行不通的。您必须在包中执行过程/函数:

DECLARE
  o_chr_errbuf  VARCHAR2(256);
  o_num_retcode NUMBER;
BEGIN 
  APPS.XXINV_ITEM_ORACLE_E5B0.inv_com_proc ( o_chr_errbuf, o_num_retcode);
END;
/

一个简单的测试:

DECLARE
  err VARCHAR2(256);
  CODE NUMBER;
BEGIN xx(err, CODE); END;

ORA-06550: line 5, column 7:
PLS-00221: 'XX' is not a procedure or is undefined
ORA-06550: line 5, column 7:
PL/SQL: Statement ignored
SQL> SELECT * FROM a;

                                     ID
---------------------------------------
SQL> DECLARE
  2    err VARCHAR2(256);
  3    CODE NUMBER;
  4  BEGIN
  5    xx.tst(err, CODE);
  6  END;
  7  /

PL/SQL procedure successfully completed
SQL> SELECT * FROM a;

                                     ID
---------------------------------------
                                      1