X-Received: by 10.224.189.78 with SMTP id dd14mr11917394qab.0.1360706333191; Tue, 12 Feb 2013 13:58:53 -0800 (PST) X-Received: by 10.49.48.41 with SMTP id i9mr1347533qen.36.1360706333170; Tue, 12 Feb 2013 13:58:53 -0800 (PST) Path: news.cambrium.nl!textnews.cambrium.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!209.85.216.87.MISMATCH!p13no13900714qai.0!news-out.google.com!k2ni24985qap.0!nntp.google.com!p13no12684243qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.databases.oracle.server Date: Tue, 12 Feb 2013 13:58:53 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.4.5.254; posting-account=KXUmygkAAABvBFmgDBe4RBLFwhTRAMZC NNTP-Posting-Host: 69.4.5.254 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: PLS-00386: type mismatch found at '...' between FETCH cursor and INTO, but why ? From: ddf Injection-Date: Tue, 12 Feb 2013 21:58:53 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.cambrium.nl On Monday, February 11, 2013 7:56:56 AM UTC-7, Spendius wrote: > Hello, > > > > Running this (on 10g R2): > > > create or replace type dual_typ as object (ddat date); > > > / > > > > > > create or replace type dual_tab as table of dual_typ; > > > / > > > > > > declare > > > cursor selDual_cur is select sysdate ddate from dual; > > > selDual dual_tab; > > > > > > begin > > > > > > open selDual_cur; > > > loop fetch selDual_cur bulk collect into selDual; > > > exit when selDual.count = 0; > > > dbms_output.put_line('ici'); > > > > > > end loop; > > > > > > end; > > > / > > > > > I always get error > > PLS-00386: type mismatch found at 'SELDUAL' between FETCH cursor and > > INTO > > on the "loop fetch selDual..." line... If I replace dual_typ as object > > (ddat date); > > with dual_typ as object (ff varchar2(2)); > > and the cursor selDual with select 'xx' from dual there's no > > difference. > > > > Someone has an idea perhaps ? > > Thanks a lot. > > Spendius The issue is the object type you're trying to base the table on -- it's unnecessary: SQL> create or replace type dual_tab as table of date; 2 / Type created. SQL> SQL> declare 2 cursor selDual_cur is select sysdate ddate from dual; 3 selDual dual_tab; 4 5 begin 6 7 open selDual_cur; 8 loop 9 fetch selDual_cur bulk collect into selDual; 10 exit when selDual.count = 0; 11 dbms_output.put_line('ici'); 12 end loop; 13 14 end; 15 / ici PL/SQL procedure successfully completed. SQL> David Fitzjarrell