Remove of Period '.' from my concatnated string.

Database

Remove of Period '.' from my concatnated string.

I want to remove periods from the concatenated string. Please help as I tried all options inlcuding Cast, Format etc.

My query is

SEL CONCAT(id, rec_num, line_no, dep_no, asp_num, pr_num) as mystr

from table_oemsp

I get the output as

mystr

0.0.300.900.0

11.20.123.123.20

etc.

I want the output as 003009000 and112012312320 for above examples. Please help.

I used to apply REPLACE function in ORACLE and SQL SERVER but TERDATA doesnt have similar function.

2 REPLIES
Highlighted
Junior Supporter

Re: Remove of Period '.' from my concatnated string.

you can try oreplace function. This is a user defined function in teradata

Junior Contributor

Re: Remove of Period '.' from my concatnated string.

CONCAT is not a built-in Teradata function.

Instead of oREPLACE better use oTRANSLATE, both are built-in since TD14, before they have to be installed as C-UDFs by a DBA.

Or concat the columns on your own (you might add a FORMAT for each column): trim(id) || trim(rec_num) || ...

Dieter