All Forums Database
mfgfd 3 posts Joined 11/08
29 Jul 2014
remove line feed, carriage return from column

Hello,
does anyone know how to remove some non-printable characters from a string in a column?
I imported data via OLE-LOAD from a MS SQL server. At least one column contains '0D0A'XB or '0A'XB. This delivers undesired results when exporting via Parallel transporter. So I have to remove those hex Strings, but
Oreplace(column, '0D0A'XB, '2020'XB) is not allowed
Is there a way in Teradata (now I export and remove in HeX-Editor)
Thanks for help
 

Raja_KT 1246 posts Joined 07/09
29 Jul 2014

Which version of Td you are using?
You can contact your DBA. Companies are driven by policies, NDA, software program downloads etc. :)
Maybe you can see few UDFs somewhere like 
https://downloads.teradata.com/download/extensibility/teradata-udfs-for-popular-oracle-functions
http://developer.teradata.com/blog/madmac/2010/03/a-few-basic-scalar-string-udfs

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

dnoeth 4628 posts Joined 11/04
29 Jul 2014

'0D0A'XB returns a binary string, you need to change it to '0D0A'XC.
And instead of oReplace you better use oTranslate to remove both characters independently:
oTranslate(column, '0D0A'XC, '  ') or to actually remove it oTranslate(column, '0D0A'XC, '')

Dieter

You must sign in to leave a comment.