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: How to do with it?

Re: How to do with it?

From: <Thenardier_at_POBoxes.com>
Date: Wed, 02 Sep 1998 03:20:24 GMT
Message-ID: <6sidho$82o$1@nnrp1.dejanews.com>


In article <35f276f6.10986646_at_news.twsc.pouchen.com.tw>,   violin.hsiao_at_mail.pouchen.com.tw (Violin) wrote:
> Hello,
> If I have a table with 3 rows:
> NAME
> ---------------
> This
> is
> test!
>
> And I have a cursor:
> DECLARE
> temp CHAR(20);
> Cursor C1 IS
> SELECT NAME FROM TEST;
>
> And I open the cursor:
> OPEN C1;
> LOOP
> FETCH C1 INTO temp;
> EXIT WHEN C1%NOTFOUND;
> /* I want to have the result : 'This is test!'. */
> temp = ??
> END LOOP;
DECLARE
   sString VARCHAR2(100);
   CURSOR C1 IS

      SELECT name Name
         FROM test;

BEGIN
   sString := ''
   FOR recC1 IN C1 LOOP

      sString := sString || RTRIM(recC1.Name)||' ';    END LOOP;
   sString := RTRIM(sString);
END; hope it helps. :)

Rgds,
Thenard

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Tue Sep 01 1998 - 22:20:24 CDT

Original text of this message

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