Efficient Script to Fix Line Terminators CHR(13)||CHR(10)
917454Mar 20 2012 — edited Mar 27 2012Hello 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