Can anyone help with this topic? I'm programming Web base applications that get (select, update, insert delete etc) data from a Oracle db. I manage to write stored proc for returning cursor to an ASP (or ADO) recordset, see the example below, that work perfect. Now my problem is that I'm trying to use nested cursor (or nested table) to be returned to an ASP page but I'm running into some difficulties. Can anyone tell me if on the good track or if I'm completly in the field ;-) with my approach.

Thanks you

Code regular cursor that works fine:

CREATE OR REPLACE PACKAGE PKG_DISTINCT_CURSOR

AS
v_date constant date := to_date('9999-12-3100:00:00','YYYY-MM-DDhh24:mi:ss');

Type cdprod_cursor IS REF CURSOR ;
Procedure p_selectdistinct_cdprod (io_cursor IN OUT cdprod_cursor) ;

END pkg_distinct_cursor;

CREATE OR REPLACE PACKAGE BODY PKG_DISTINCT_CURSOR AS

Procedure p_selectdistinct_cdprod (io_cursor IN OUT cdprod_cursor)
IS
v_cursor cdprod_cursor;
BEGIN
OPEN v_cursor FOR select distinct cd_prod, cd_catprod, desc_abrg_prod
from prod where dt_fin_prod = v_date order by cd_catprod, desc_abrg_prod;
io_cursor := v_cursor;
close v_cursor;
END p_selectdistinct_cdprod;
END pkg_distinct_cursor;

and now in my asp page I call (I'll spare you the code for the recorset and connection and all) the proc this way :
strsql_prod = "{call pkg_distinct_cursor.p_selectdistinct_cdprod({resul tset 0, io_cursor})}"


now what I'm trying to do with a nested table in a cursor (or a nested cursor if that would work)

CREATE OR REPLACE PACKAGE PKG_CURSOR_WEB
IS

Type ModuleTabTyp IS TABLE OF fd_statut_personne.id_module%type INDEX BY BINARY_INTEGER;

Type MotifRecTyp IS RECORD (
id_personne fd_personne.id_personne%type,
nom fd_personne.nom%type,
prenom fd_personne.prenom%type,
naissance_dt fd_personne.naissance_dt%type,
id_module ModuleTabTyp);

Type fdper_cursor IS REF CURSOR return MotifRecTyp;
-- or should I use weak cursor??

Procedure p_array_table (parameter IN number, io_cursor IN OUT fdper_cursor);
END PKG_CURSOR_WEB;

(that part compiles OK)

CREATE OR REPLACE PACKAGE BODY PKG_CURSOR_WEB AS

PROCEDURE p_array_table (parameter IN number,io_cursor IN OUT fdper_cursor)

IS


v_cursor fdper_cursor;

BEGIN



OPEN v_cursor for

SELECT fd_personne.id_personne, fd_personne.nom, fd_personne.prenom, fd_personne.naissance_dt,
cursor(select id_module
from fd_statut_personne
where fd_statut_personne.id_personne = fd_personne.id_personne)
FROM fd_personne
WHERE fd_personne.id_personne in or = <parameter> ;

loop
fetch fdper_cursor into v_cursor;
exit when v_cursor%notfound;
end loop;
io_cursor := v_cursor;
close v_cursor;

END p_array_table;

I get this error message at the line of the Select fd_personne.... :
PLS-00382: expression is of wrong type

What Iam I doing wrong here (a lot I suppose) and what would the call form an Asp page would look like, or it is not possible this way, what is the best way.

Thanks a lot guys