Please help me with varray
551855Jun 1 2007 — edited Jun 1 2007Hello
when I compile my code, I get the following error
Error(1211,14): PLS-00382: expression is of wrong type
below is the creation of the varray
CREATE TYPE calendar_list as VARRAY(1000) of REF xx_bk_calendars;
below is xx_bk_calendars
CREATE type xx_bk_calendars as object (
CALENDARID NUMBER
,EXTERNALSYSTEMID NUMBER
,CALENDARCODE VARCHAR2(12)
,DESCRIPTION VARCHAR2(30)
,MAXDAYS NUMBER
,MINDAYS NUMBER
,MINTIME DATE
,LASTCREATIONDATE DATE
,HISTORYDAYS NUMBER
);
below is my code
FUNCTION getEmpArray RETURN calendar_list
IS
-- declare variables to hold the values from the cursor
lc_Profile_Value VARCHAR2(18);
lc_fnd_profile VARCHAR2(18);
lc_open_quote VARCHAR2(100);
l_data calendar_list := calendar_list();
CURSOR c_cal IS SELECT calendarid
,externalsystemid
,calendarcode
,description
,maxdays
,mindays
,mintime
,lastcreationdate
,historydays
FROM xx_bk_calendar;
BEGIN
FOR emp_rec IN c_cal
LOOP
l_data.extend;
l_data(l_data) := emp_rec;
l_data(l_data.last) := emp_rec;
END LOOP;
RETURN l_data;
END;
I get the error for the bolded code. Please help