Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Query Question

Re: Query Question

From: mike <hillmw_at_charter.net>
Date: 11 Mar 2005 11:34:18 -0800
Message-ID: <1110569658.319534.143830@g14g2000cwa.googlegroups.com>


I modified this statement with my scenario and ran it.

create or replace function list ( field1 number ) return varchar2 as

   res varchar2(2000) := null;
   first boolean := true;
begin

   for curs in

       (select fld2 from crosstab where fld1 = field1 order by fld2 )    loop

      if not first then
         res := res || ', ';
      else
         first := false;
      end if;
      res := res || curs.fld2;

   end loop;
return res;
end list;

I got the following message from Oracle: "Proceed".

So then I ran modified with my scenario and ran it

select fld1, list(fld1) fld2
from crosstab
group by fld1

I got the following message from Oracle: "Package or Function LIST is in an invalid state".

What is up with that? Do I put them both together?

Mike Received on Fri Mar 11 2005 - 13:34:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US