2011-10-07 175 views
2

我有一個創建和聲明不同類型的過程。但每次我寫一次「創建型」或「聲明型」我得到這個錯誤:這個錯誤是什麼意思,它爲什麼會出現?

ERROR line 4, col 10, ending_line 4, ending_col 18, Found 'recipient', Expecting: ( . @ or % or .. := DEFAULT NOT NULL or ;

我使用Oracle 10,這些都是程序的第一線。錯誤

CREATE OR REPLACE PROCEDURE ACTIVITE_PROD.NOTIF_NEW_HOLIDAY(v_USER_ID INTEGER,  v_DURATION NUMBER, v_WEEK INTEGER, v_YEAR INTEGER) IS 

-- this line causes the error 
create type recipient as object (firstname varchar2, lastname varchar2, email varchar2); 

-- this line also causes an error if modified and set first 
declare 
    type recipients_list is table of recipient; 

    admins recipients_list := recipients_list(); 

我的代碼出了什麼問題?

回答

7

從Oracle文檔Using PL/SQL With Object Types

Currently, you cannot define object types in a PL/SQL block, subprogram, or package. You can define them interactively in SQL*Plus using the SQL statement CREATE TYPE.