Re: SQL return all rows concatenated?

From: godmann <allanwtham_at_yahoo.com>
Date: 7 Sep 2001 00:28:44 -0700
Message-ID: <95cd51c.0109062328.3f9d7bf5_at_posting.google.com>


Hi there,  

Try the code below:



set serveroutput on
declare
  ddstr varchar(100):=null;
  cursor c1 is select dow from daytab;
  • you should create a table called daytab with a dow field
  • insert into dow field values like Monday to Sunday

begin

   for crec in c1 loop

      ddstr := concat(ddstr,crec.dow);   end loop;

  ddstr := concat('>>',ddstr);
  ddstr := concat(ddstr,'<<');
  dbms_output.put_line(ddstr);
  

end;
/


Allan W. Tham
DBA Received on Fri Sep 07 2001 - 09:28:44 CEST

Original text of this message