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!

Remove trailing carriage returns on CLOB

vpolasaMar 7 2016 — edited Mar 7 2016

Hi,

I have a CLOB datatype and trying to remove all the extra trailing carriage returns from the column for all records in an update statement. Below is an example:

Row1: abc

cde

efg

Row2:afd

edg

Row3:wed

iek

Row4:okwq

wiekd

kdld

Output should be: (please note the trailing carriage returns of row1 and 3 are removed)

Row1: abc

cde

efg

Row2:afd

edg

Row3:wed

iek

Row4:okwq

wiekd

kdld

Below is the sample data. I'd like to run an update statement, that removes the trailing carriage returns(if exists) for each row. In the blow example, it should remove for the first record.

CREATE TABLE TEST_TRAIL (MYCLOB CLOB);

INSERT INTO TEST_TRAIL VALUES (

'Imports Core.Metadata

Inherits EntityFieldCustomization

End Class

');

INSERT INTO TEST_TRAIL VALUES (

'Imports Core.DataManager.Customization

Public Class DP_COMMENT_CHR

Inherits EntityFieldCustomization

End Class');

Using Oracle 11gR2, Windows7

Thanks

This post has been answered by Paulzip on Mar 7 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2016
Added on Mar 7 2016
7 comments
1,315 views