Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ora-06531 reference to uninitialized collection

HuronJul 29 2014 — edited Jul 30 2014


Hello.

I have a problem trying solving this error, in a package. If anyone could help me. (i readed in gogole this error is caused if the colection is not inicitalized, but i am using a constructor and i am getting the same error).

My code:

In my package-specification:

TYPE ECO_CLIENTES_REG IS RECORD (


VARCHAR2(10) not null :=' ',

VARCHAR2(100) not null:= ' ',

VARCHAR2(10)not null := ' ');

TYPE mi_reg2 is table of ECO_CLIENTES_REG;

DATOS2 mi_reg2 := mi_reg2(); /*constructor, inicialiting the collection trying evade the error. Without Success */


My package-body:

CARGAR_ECO_CLIENTES (P_CLIENTE IN OUT mi_reg2) IS

         cursor mi_cli is   SELECT NIF, NOMBRE, CODIGO_POSTAL

                                     FROM ECO_CLIENTES

                                     ORDER BY NIF DESC;       

       i number :=1;


BEGIN


open mi_cli;

loop

    fetch mi_cli into P_CLIENTE(i).nif, P_CLIENTE(i).nombre, P_CLIENTE(i).codigo_postal;

    exit when mi_cli%notfound;

    i : i +1;

end loop;   

close mi_clie;

-------

When i debug my package. when the debug-pointer execute the "fetch", the pointer go inmediatily to the EXCEPTION zone, showing this error:

ORA-06531.

If anyone could help me.

Thanks


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2014
Added on Jul 29 2014
10 comments
3,857 views