I have a procedure that creates and declares different types. But every time I write 'create type' or 'declare type' I get this error:
ERROR line 4, col 10, ending_line 4, ending_col 18, Found 'recipient', Expecting: ( . @ or % or .. := DEFAULT NOT NULL or ;
I use Oracle 10 and these are the first lines of the procedure. The error
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();
What is wrong with my code?