I have a type like
CREATE OR REPLACE TYPE MY_TYPE AS OBJECT
(
id NUMBER(10, 0),
name VARCHAR2(4),
lastName VARCHAR2(13),
address VARCHAR2(30),
previousAddress VARCHAR2(80)
);
and a table of these as
CREATE OR REPLACE TYPE MY_TYPE_ROWS AS TABLE OF MY_TYPE
what I want to do is insert some rows that are returned from a cursor in this "MY_TYPE_ROWS" table. (and i want to do that in a pl/sql procedure)
The data that I want to insert into "MY_TYPE_ROWS" are in a cursor like:
cursor dataCursor IS
select
id,name, lastName,address,previousAddress
from table1;
(cursor returns more than 1 row)
I've tried something like:
my_table_rows MY_TYPE_ROWS := MY_TYPE_ROWS ();
OPEN dataCursor ;
FETCH dataCursor
INTO my_table_rows;
CLOSE dataCursor ;
but i am getting an exception "Error: PLS-00386: type mismatch found at 'my_table_rows' between FETCH cursor and INTO variables"
thanks