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: Rows to a List

Re: Rows to a List

From: Barbara Boehmer <baboehme_at_hotmail.com>
Date: 3 Aug 2005 13:05:48 -0700
Message-ID: <1123099548.678849.268330@g14g2000cwa.googlegroups.com>


Checking and setting the value of first within each iteration of the loop may be slowing things down. You could just trim the extra comma after the loop:

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

   res varchar2(2000) := null;
begin

   for curs in

       (select fldz from tbl_y where num=field1 order by fldz)    loop

       res := res || ',' || curs.fldz;
   end loop;
return ltrim (res, ',');
end list; Received on Wed Aug 03 2005 - 15:05:48 CDT

Original text of this message

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