Oracle SQL Error: ORA-06550

I am getting the following Oracle error on the following test code below. From what I can tell the variables do match, what am I missing?

Also attached is the object type for your reference.

13:33:15 Error: ORA-06550: line 28, column 37: PLS-00386: type mismatch found at 'MAIL_TAB' between FETCH cursor and INTO variables ORA-06550: line 28, column 1: PL/SQL: SQL Statement ignored

DROP TYPE PRINUSER.t_prin_cp_mails;
DROP TYPE prinuser.t_prin_cp_mail;

CREATE TYPE prinuser.t_prin_cp_mail AS Object
(
   mag_ind  varchar2(10),
   mail_id  varchar2(100),
   mail_name varchar2(200),
   street_1 varchar2(200),
   street_2 varchar2(200),
   street_3 varchar2(200),
   city  varchar2(200),
   state varchar2(200),
   zip varchar2(200),
   nation varchar2(200),
   dpcd varchar2(15),
   xref_pidms varchar2(1000),
   num_copies number,
   v_multi_purpose_1  varchar2(500) -- List of mags
)
;
/
CREATE TYPE PRINUSER.t_prin_cp_mails AS TABLE OF t_prin_cp_mail;


declare
mail_tab                    t_prin_cp_mailS := t_prin_cp_mailS();

CURSOR mail_cursor IS
(
SELECT
  ' ' AS  mag_ind  ,
  ' ' AS  mail_id  ,
  ' ' AS  mail_name,
  ' ' AS  street_1 ,
  ' ' AS  street_2 ,
  ' ' AS  street_3,
  ' ' AS  city  ,
  ' ' AS  state ,
  ' ' AS  zip ,
  ' ' AS  nation ,
  ' ' AS  dpcd ,
  ' ' AS  xref_pidms ,
  1 AS num_copies ,
  ' ' AS  mags  
FROM DUAL
);

BEGIN
-- populate collection to manipulate
OPEN mail_cursor;

FETCH mail_cursor BULK COLLECT INTO mail_tab limit 100;
CLOSE mail_cursor;
end;

John
prinprogAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
Instead of selecting individual columns, try selecting the TYPE.

Try this:

DROP TYPE t_prin_cp_mails;
 DROP TYPE t_prin_cp_mail;

 CREATE TYPE t_prin_cp_mail AS Object
 (
    mag_ind  varchar2(10),
    mail_id  varchar2(100),
    mail_name varchar2(200),
    street_1 varchar2(200),
    street_2 varchar2(200),
    street_3 varchar2(200),
    city  varchar2(200),
    state varchar2(200),
    zip varchar2(200),
    nation varchar2(200),
    dpcd varchar2(15),
    xref_pidms varchar2(1000),
    num_copies number,
    v_multi_purpose_1  varchar2(500) -- List of mags 
 )
 ;
 /

 CREATE TYPE t_prin_cp_mails AS TABLE OF t_prin_cp_mail;
 /


 declare
 mail_tab                    t_prin_cp_mailS := t_prin_cp_mailS();

 CURSOR mail_cursor IS
 (
 SELECT 
   t_prin_cp_mail(' ',
   ' ' ,
   ' ' ,
   ' ' ,
   ' ' ,
   ' ' ,
   ' ' ,
   ' ' ,
   ' ' ,
   ' ' ,
   ' ' ,
   ' ' ,
   1 ,
   ' ' )
 FROM DUAL
 );

 BEGIN
 -- populate collection to manipulate
 OPEN mail_cursor;

 FETCH mail_cursor BULK COLLECT INTO mail_tab limit 100;
 CLOSE mail_cursor;
 end;
/

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
prinprogAuthor Commented:
Thanks that work!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.