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 convert result rows into comma separated values

prakashJan 4 2012 — edited Jan 5 2012
hi,

Version
BANNER

Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE	11.1.0.7.0	Production
TNS for Linux: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
Query
Select distinct prcdr_code from procedure p where P.PRCDR_CTGRY_LKPCD='P' ;

Output
-----------
PRCDR_CODE

0001F
0001T
0002F
0002T
0003F
0003T
0004F
0005F
0005T
0006F
0006T
0007F
0007T
0008F
0008T
0009F
0009T
000VA
000VG
.....
...

Desired Output
-------------------
0001F,0001T,0002F,0002T .................


My work
----------------
i tried this .....

Select distinct wm_concat(prcdr_code) as re from procedure p where P.PRCDR_CTGRY_LKPCD='P'  ;

But i got ORA-22813: operand value exceeds system limits error



Please help me ..
Thanks,
P Prakash

Edited by: prakash on Jan 4, 2012 9:05 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2012
Added on Jan 4 2012
14 comments
12,385 views