我是甲骨文收藏的新手。所以请指导我将关联数组转换为游标(SYS_REFCURSOR)。
/*-----------my snippnet like this---*/
/*--declared in package*/
TYPE GENARRAY IS TABLE of NUMBER INDEX BY BINARY_INTEGER;
/*--defined in package body*/
1.FUNCTION GETXXX_GETFOLDERS1 (IN_ARRAY GENARRAY) RETURN SYS_REFCURSOR AS
OUTTABLE GENARRAY;
GRPID NUMBER;
VCOUNT NUMBER:=0;
return_cursor SYS_REFCURSOR;
2. BEGIN
FOR I IN 1..IN_ARRAY.COUNT LOOP
3. VCOUNT:=VCOUNT+1;
4. SELECT GROUPID INTO GRPID FROM DMBI_GROUPDETAIL WHERE GROUPNAME IN (IN_ARRAY(I));
OUTTABLE(VCOUNT):=GRPID;
END LOOP;
5. Open return_cursor FOR
SELECT * FROM TABLE (CAST(OUTTABLE AS GENARRAY));
6. RETURN return_cursor;
END GETXXX_GETFOLDERS1;
----ERROR on line which is in bold-----
Error(5): PL/SQL: SQL Statement ignored
Error(5): PL/SQL: ORA-00902: invalid datatype
---------------------------------------------------