string contains new line character (LF/CR)

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
fyaqq
Participant
Posts: 43
Joined: Thu Aug 31, 2006 5:05 pm

string contains new line character (LF/CR)

Post by fyaqq »

In the oracle table there is a new line character in a field of a row whose type is varchar(30).
First I use oracle stage ---> sequential File, no problem at all.
Later I need to read the sequential file back to another oracle table, b/c of the new line character, all the following records got missed up.

Is there anyway to get rid of the annoying LF/CR within a string?

BTW, the string contains all chinese characters.

Thank you very much!
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Is LF/CR at the end of the string or within the string? On the columns tab in the sequential stage select the attribute "Contains Terminators" to Yes in your first job and in your second job. That should take care of the error. If not come back :wink:
Kris

Where's the "Any" key?-Homer Simpson
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You can use the

Code: Select all

convert(char(10):char(13),'',In.ColumnName)
command to remove all occurrences of CR and LF in your string.
Post Reply