如何查询oracle包中的表类型

时间:2013-06-05 09:24:03

标签: oracle11g

我想使用sql查询对象,如下面的代码。

PACKAGE:


PACKAGE DRAWING AS 
TYPE AWARD_NUMBER_ROW IS RECORD (
      A_NUMBER    VARCHAR2 (10),
      A_TYPE      char (1)
  ); 

TYPE AWARD_ROW IS RECORD (
      A_NUMBER    VARCHAR2 (10),
      A_NAME      VARCHAR2 (50)
  ); 

TYPE AWARD_NUMBER_TABLE IS TABLE OF AWARD_NUMBER_ROW  INDEX BY PLS_INTEGER; 
TYPE AWARD_TABLE IS TABLE OF AWARD_ROW  INDEX BY PLS_INTEGER; 

AWARD AWARD_TABLE;
AWARD_T AWARD_TABLE; 

PROCEDURE DRAWING (AWARD_NUMBER IN AWARD_NUMBER_TABLE);

END DRAWING;

BODY:


create or replace 
PACKAGE BODY DRAWING AS
PROCEDURE DRAWING (AWARD_NUMBER IN AWARD_NUMBER_TABLE) AS
BEGIN
    EXECUTE IMMEDIATE
    'SELECT * FROM AWARD_INF'
    BULK COLLECT INTO AWARD_T;

    /*
          error is from here. AWARD_T does not exist or is marked for delete
    */
    SELECT T.* bulk collect into AWARD FROM TABLE(AWARD_T ) T WHERE T.A_NAME = '123456789' ;

END DRAWING; 
END INVOICE_DRAWING

这是异常消息。

ORA-21700:对象不存在或标记为删除 “对象不存在或标记为删除” *原因:用户试图执行不适当的操作            一个不存在或标记为要删除的对象。            固定,删除和更新等操作不能            应用于不存在或标记为删除的对象。 *操作:用户需要重新初始化引用以引用            现有对象或用户需要取消标记对象。

我该如何解决?

0 个答案:

没有答案