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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Concatenate rows

RE: Concatenate rows

From: Abdul Aleem <abchaudhary-ho_at_beaconhouse.edu.pk>
Date: Sun, 01 Apr 2001 21:34:59 -0700
Message-ID: <F001.002DDF9E.20010401210044@fatcity.com>

<span

style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'>May be you could try this, this requires a little more effort, but assures that complete contents will be displayed.

<span

style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'> 

<span

style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'>Try using a CURSOR FOR LOOP of the fetched record, have the contents copied to a text file, and display the text file using OLE etc. controls.

<span

style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'> 

<span

style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'>HTH!

<span

style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'> 

<span

style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'>Aleem

<span

style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'> 

<span

style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'> 

<font size=2 color=black

face=Tahoma>-----Original
Message-----
From: Wendy Y
[mailto:lannyue_at_yahoo.com]
Sent: Monday, April 02, 2001 6:25
AM
To: Multiple recipients of list
ORACLE-L
Subject: RE: Concatenate rows

<span

style='font-size:12.0pt'> 

<span

style='font-size:12.0pt;color:black'> Aleem:<font color=black>

<span

style='font-size:12.0pt;color:black'>Yes, your understand right! I'm concating ROWS, not columns.<span style='color:black; mso-color-alt:windowtext'>

<span

style='font-size:12.0pt;color:black'>My client has several comment text box (columns). When the previous fired, it will send couple of messages (rows) as comments - the way it designed. They need to combine these text comments into one comment box. <span
style='color:black;mso-color-alt:windowtext'>

<span

style='font-size:12.0pt;color:black'>My delimn: previously each text box is varchar2(2000), of course I may have 3-6 of these messages. But after concating, the text box will still be varchar2(2000). I understand that to concate them all will not lose anything. Than I have to go through a cursor loop as you suggested. But is therre another way to do this without missing anything? <span style='color:black;mso-color-alt: windowtext'>

<span

style='font-size:12.0pt;color:black'>And keep in mind that all of these are in my mutating table trigger.<span
style='color:black;mso-color-alt:windowtext'>

<span

style='font-size:12.0pt;color:black'>Thanks for all the advise!<font color=black>

<span

style='font-size:12.0pt;color:black'>Wendy<span style='color:black;mso-color-alt:windowtext'>

<span

style='font-size:12.0pt;color:black'>  <span style='font-weight: bold;font-style:italic'>Abdul Aleem <abchaudhary-ho_at_beaconhouse.edu.pk> wrote: <span style='color:black;mso-color-alt: windowtext'>

<p class=MsoNormal style='margin-right:.5in;mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;margin-left:39.75pt;border:none;mso-border-left-alt:solid #1010FF 1.5pt; padding:0in;mso-padding-alt:0in 0in 0in 4.0pt'><font size=3 color=black face="Times New Roman">Wendy,

If I understood you correctly,

You need to create a cursor, then scan it in a loop and have column(s) of each row concatenated to a variable. The variable I feel has to be a varchar2 with enough size to hold the data of all the rows.

Just curious, apparently this does not seem to be a good thing to do, if you could kindly share why do you want to do this.

HTH! Aleem,

-----Original Message-----
Sent: Friday, March 30, 2001 8:36 PM
To: Multiple recipients of list ORACLE-L

Hi Wendy,

Here's an example from a PL/SQL procedure:

inputFromDate := startMonth||'/'||startDay||'/'||startYear;

The '/' is a delimiter, if you don't want one just use:

inputFromDate := startMonth||startDay||startYear;

The individual data elements in this case were user input on a web! ! browser, but the same syntax applies if the elements had been selected from tables.

Hope this helps.

David A. Barbour
Oracle DBA, OCP

Wendy Y wrote:

> 
> Hello:
> 
> Is there a way that we can Concatenate several rows (say 6 rows from a
> select statement) into one variable?
> 
> Thanks
> 
> Wendy
> 
> ----------------------------------------------------------------------
> Do You Yahoo!?
> Yahoo! Mail Personal Address - Get email at your own domain with
> Yahoo! Mail.
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: David A. Barbour
INET: dbarbour_at_nucentrix.net

Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an! E! ! -Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Abdul Aleem
INET: abchaudhary-ho_at_beaconhouse.edu.pk

Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).<font
color=black>


<p style='margin-right:.5in;margin-left:39.75pt;border:none;mso-border-left-alt:
solid #1010FF 1.5pt;padding:0in;mso-padding-alt:0in 0in 0in 4.0pt'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt; color:black'> <font color=black>
<div class=MsoNormal align=center style='margin-right:.5in;mso-margin-top-alt:
auto;mso-margin-bottom-alt:auto;margin-left:39.75pt;text-align:center; border:none;mso-border-left-alt:solid #1010FF 1.5pt;padding:0in;mso-padding-alt: 0in 0in 0in 4.0pt'><span style='font-size:12.0pt;color:black'>
<p class=MsoNormal style='margin-right:.5in;mso-margin-top-alt:auto;mso-margin-bottom-alt:
auto;margin-left:39.75pt;border:none;mso-border-left-alt:solid #1010FF 1.5pt; padding:0in;mso-padding-alt:0in 0in 0in 4.0pt'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:black;font-weight: bold'>Do You Yahoo!?<span style='color: black'> Yahoo! Mail Personal Address - Get email at your own domain with Yahoo! Mail.<font color=black>
Received on Sun Apr 01 2001 - 23:34:59 CDT

Original text of this message

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