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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

regexp_replace to remove blank lines from multi lines in a single field

kron777Feb 3 2012 — edited Feb 3 2012
Gents. 10g R2.
   with test_tab as 
   (select 'x'||chr(10)||'y'||chr(10)||chr(10)||'z' tester from dual)
   select tester from test_tab
produces
x
y

z
I require
x
y
z
There's a lot of examples on how to end up with xzy, but I need to maintain the carriage returns, just strip out blank lines.

I've been trying with posix [:cntrl:] but it doesn't seem to want to work. Question: how to get the desired output?

If this has been answered on another post, please point me in the right direction and accept my apologies!
This post has been answered by Frank Kulash on Feb 3 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2012
Added on Feb 3 2012
5 comments
10,319 views