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!

Efficient Script to Fix Line Terminators CHR(13)||CHR(10)

917454Mar 20 2012 — edited Mar 27 2012
Hello Everyone,

I'm trying to parse incoming data to make sure the Line Terminators are the used by Windows: CHR(13)||CHR(10). The information is inside a CLOB.
In my tests I putted the value into a Varchar2 and did this to detect the differences:

FOR loop_counter IN 1 .. l_len
Loop
C_Char := Substr(S_Value, Loop_Counter, 1);
Dbms_Output.Put_Line('Char '|| loop_counter||': '|| C_Char );
END LOOP;

I can see CHR(13)||CHR(10) with this and also do some logic to replace them.

My Question is:
How do I detect efficiently when there are only CHR(13) and change then to CHR(13)||CHR(10).
I plan to put this code on a trigger.

Thanks in advance.

Mijail O. T.

Edited by: 914451 on Mar 20, 2012 6:35 AM
This post has been answered by TPD-Opitz on Mar 21 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 24 2012
Added on Mar 20 2012
8 comments
589 views