I have create a stored procedure that takes a table from another stored procedure (using dblink). I want to create a new table from this and to build a cursor from table.

The error is generated when I use:

tabtest(tabtest.last).t_identNR:=tabPra(ind_Pra).t _identNR;

and the error is:

ORA-06530: Reference to uninitialized composite
ORA-06512: at "ADIUVAT.GETSELEZPRAT", line 86
ORA-06512: at line 1

This is my code:


CREATE OR REPLACE PROCEDURE GetSelezPrat (p_recordset1 OUT Types.cursor_type,ret out number,num out number) AS
TYPE rec_pratiche IS RECORD(T_IDENTNR NUMBER (8),
T_CTD_IDENT VARCHAR2 (2), --categoria domanda
T_ANNO_DOM NUMBER (4),
T_NUMERO_DOM NUMBER (8),
T_TPD_IDENT VARCHAR2 (2), --tipo domanda
T_DATA_DOMANDA DATE,
T_STD_IDENTNR NUMBER (2), --stato domanda
T_STD_DESCR VARCHAR2 (50), --stato domanda
T_MSP_IDENTNR NUMBER (2), --motivo sospensione
T_MSP_DESCR VARCHAR2 (50), --motivo sospensione
T_DATA_ANNULLAMENTO DATE,
T_PRIMO_ACCERTAMENTO NUMBER (1),
T_TPE_IDENT VARCHAR2 (3), --codice esito
T_TPE_DESCR VARCHAR2 (300), --descrizione esito
T_TAC_IDENTNR NUMBER (2), --tipo accertamento
T_TAC_DESCR VARCHAR2 (50), --tipo accertamento
T_MAC_IDENTNR NUMBER (2), --codice modalit` acc.
T_MAC_DESCR VARCHAR2 (50), --descr. modalit` acc.
T_PTL_IDENTNR NUMBER (2), --codice PATOLOGIA
T_PTL_DESCR VARCHAR2 (50), --descrizione PATOLOGIA
T_MESI_REVISIONE NUMBER (2),
T_DTDEF_PRATICA DATE,
T_PERC_INVALIDITA NUMBER (3),
T_DATA_DECORRENZA DATE,
T_NOTE_STAMPA VARCHAR2 (2000),
T_DATA_MODIFICA DATE,
T_DATA_VISITA DATE,
T_COD_MED1 VARCHAR2 (3), --MEDICO 1
T_COGNOME_MED1 VARCHAR2 (50), --MEDICO 1
T_NOME_MED1 VARCHAR2 (50), --MEDICO 1
T_COD_MED2 VARCHAR2 (3), --MEDICO 2
T_COGNOME_MED2 VARCHAR2 (50), --MEDICO 2
T_NOME_MED2 VARCHAR2 (50), --MEDICO 2
T_COD_MED3 VARCHAR2 (3), --MEDICO 3
T_COGNOME_MED3 VARCHAR2 (50), --MEDICO 3
T_NOME_MED3 VARCHAR2 (50)); --MEDICO 3
TYPE rec_disabilita IS RECORD(T_ANNO_DOM NUMBER (4),
T_NUMERO_DOM NUMBER (8),
T_TPD_IDENT VARCHAR2 (2), --tipo domanda
T_DAB_IDENTNR NUMBER (2),
T_DAB_DESCR VARCHAR2 (50));
TYPE tblDis IS TABLE OF rec_disabilita;-- INDEX BY BINARY_INTEGER;
TYPE rec_diagnosi IS RECORD(T_ANNO_DOM NUMBER (4),
T_NUMERO_DOM NUMBER (8),
T_TPD_IDENT VARCHAR2 (2), --tipo domanda
T_DIA_IDENT VARCHAR2 (4), --codice diangnosi
T_DIA_DESC VARCHAR2 (200),
T_DESCR VARCHAR2 (200),
T_INTERVENTO NUMBER (1));
TYPE tblDia IS TABLE OF rec_diagnosi;-- INDEX BY BINARY_INTEGER;
ind_dia number;
num_dia number;
ind_dis number;
num_dis number;
ind_pra number;
num_pra number;
cod_err number;
IDENTNR NUMBER (8);
CTD_IDENT VARCHAR2 (2);
ANNO_DOM NUMBER (4);
NUMERO_DOM NUMBER (8);
TPD_IDENT VARCHAR2 (2);
DATA_DOMANDA DATE;
tabPra ulnk01.RICERCA_PRATICHE.tblPra@AMLTEST.UNIGEN02.AZ I;
tabDia ulnk01.RICERCA_PRATICHE.tblDia@AMLTEST.UNIGEN02.AZ I;
tabDis ulnk01.RICERCA_PRATICHE.tblDis@AMLTEST.UNIGEN02.AZ I;
rec rec_pratiche;
tabtest my_tab_type:= my_tab_type();
BEGIN
ind_Pra := 1;
num_PRA := '';
IDENTNR := 123;
CTD_IDENT := '';
ANNO_DOM := '';
NUMERO_DOM := '';
TPD_IDENT := '';
DATA_DOMANDA := '';
ulnk01.RICERCA_PRATICHE.Selezione_pr...UNI GEN02.AZI(IDENTNR,CTD_IDENT,ANNO_DOM,NUMERO_DOM,TPD_IDENT,D ATA_DOMANDA,tabPra,num_pra,tabDis,num_Dis,tabDia,n um_Dia,COD_ERR);
ret :=cod_err;
num:=num_pra;
while ind_Pra <= num_pra loop
tabtest.extend;
tabtest(tabtest.last).t_identNR:=tabPra(ind_Pra).t _identNR;
tabtest(tabtest.last).t_CTD_IDENT:=tabPra(ind_Pra) .t_CTD_IDENT;
tabtest(tabtest.last).t_ANNO_DOM:=tabPra(ind_Pra). t_ANNO_DOM;
tabtest(tabtest.last).t_NUMERO_DOM:=tabPra
Please help me and sorry for my bad english