"Replace" in Teradata - Only SQL statements ?

Database
Enthusiast

"Replace" in Teradata - Only SQL statements ?

Hi All

I'm trying to implement Oracle REPLACE() function in teradata using SQL statements only. I searched the forum , but found Oreplace() UDF as the only solution.  Can someone help me in implementing this is pure teradata SQL  ?? 

Thanks

Praneeth

7 REPLIES
Enthusiast

Re: "Replace" in Teradata - Only SQL statements ?

Depends upon what you want to do, usually you can do it using different combinations of functions like, CASE WHEN, SUBSTR, LENGTH or CHAR_LENGTH, POSITION etc.

If possible, post the sample of data on which you want to apply REPLACE and can help in converting it in pure teradata SQL.

Junior Supporter

Re: "Replace" in Teradata - Only SQL statements ?

TD 14 implements oReplace() as a native Teradata Function.

HTH.

Cheers.

Carlos.

Senior Apprentice

Re: "Replace" in Teradata - Only SQL statements ?

Hi Praneeth,

you shouldn't try to implement REPLACE with basic SQL functions, it's not worth doing it.

Better get your dba to install oREPLACE (and some more Oracle UDFs like oTRANSLATE).

Dieter

Enthusiast

Re: "Replace" in Teradata - Only SQL statements ?

Thanks for the response guys. 

Carlos -- I couldnt find any Oreplace function in TD 14. Could you help me in using in ver 14.

Enthusiast

Re: "Replace" in Teradata - Only SQL statements ?

dnoeth - you're right . but we need to go through a hell lot of proocesses and approvals for this. Thats why i was thinking of SQL implemtation . anyways , thanks for the suggestion. If nothing works out at the end , this would be the only solution.

Junior Supporter

Re: "Replace" in Teradata - Only SQL statements ?

"SQL Functions, Operators, Expressions, and Predicates". OREPLACE() Pag 720.

Before you can use the embedded services functions, you must run the Database Initialization

Program (DIP) utility and execute the DIPALL or DIPSYSFNC script. DIPALL is executed as

part of system installation.

Cheers.

Carlos.

Enthusiast

Re: "Replace" in Teradata - Only SQL statements ?

got it. Thanks Carlos.