Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to break(line break) concatenate in a loop.

1503602Jun 12 2015 — edited Jul 6 2015

Hi,

I have to break the concatenate string which am storing in a variable. I tried using chr(13)||chr(10) in the pl/sql code, but am unable to break it.

How can i break it

The code looks like....

my variable declaration,

l_msg       CLOB            := NULL;

FOR po_rec IN c1

LOOP

l_msg := l_msg||chr(13)||chr(10)||

                   po_rec.e_type

                 || '   '

                 || po_rec.e_name

                 || '   '

                 || po_rec.e_count

                 ||chr(13)||chr(10);

END LOOP;

In this way am using the code, am able to get the output but it is continuously coming, i mean concatenating all rows into 1 row.

the output should come like this.

xxx aaaa 4

yyy bbbb 5

zzz cccc 6

but it is coming in this way,

xxx aaaa 4 yyy bbbb 5 zzz cccc 6

This post has been answered by Sanjaya Kumar Pradhan on Jun 12 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 3 2015
Added on Jun 12 2015
19 comments
4,285 views