Replace( ) & Ascii Characters:CHR( ) in Teradata

Analytics

Replace( ) & Ascii Characters:CHR( ) in Teradata

Hi All,

Is there any function available in Teradata to replace a string with another one?

Also how are the Ascii characters included in string operations in Teradata like in the following Oracle-SQL codes:

* replace(replace(replace(prd_title, chr(9), ''), chr(10), ''), chr(13), '')

* select part_id || CHR(009) || part_name from product_tbl;

Please suggest me the equivalents of the following in Teradata:
replace()
CHR(9)-Tab key
CHR(10)-Enter key
CHR(13)- Carriage Return
1 REPLY
Enthusiast

Re: Replace( ) & Ascii Characters:CHR( ) in Teradata

Hi TD_USER
About the Ascii characters included in string operations in Teradata:
as in Oracle CHR(10), you can use in teradata the hexa equivalent
(i.e. '0A'XC)
or for CHR(09) '09'XC or for CHR(13) '1C'XC etc.

I use por exampel for the generation of a dynamic sqls for concatenations
the hexa equivalent for quotes CHR(39)='27'XC.
(i.e. select'SELECT * FROM dbc.AccLogTbl where DatabaseName='||'27'XC||hdbname||'27'XC||.. etc.)

About the Oracle replace Function:
you have to write thus mentioned UDFs (User Defined Functions)
to simulate the Oracle replace function. For UDF User Guide
look at: www.info.ncr.com/eDownload.cfm?itemid=033360020
NCR offered UDF functions for Oracle migrations.
perhaps write someone of the NCR people something about that.
Or search in http://www.teradataforum.com/

hth
stami27