Code Conversion

Database
Vga
Enthusiast

Code Conversion

Experts,

I tried to convert a netezza code to Teradata. Just wanted to confirm, if I have done it correclty.

NZ: LTRIM(TRANSLATE(PHONE_NBR,'  (',''),'1 ')

TD: TRIM (LEADING '1' FROM LCI_UD_FUNCTION.OTRANSLATE(PS_PRO.PRIM_PHONE_NBR,'  (',' '))

As per my research in NZ, Translate & LTRIM functions replaces characters not a whole string. So, not sure if the TD code will work as expected.

Help appretiated!

2 REPLIES
WAQ
Enthusiast

Re: Code Conversion

In Teradata TRIM LEADING '1' will also replace leading 1 from your string and rest of the string will remain same.

Enthusiast

Re: Code Conversion

Why don't you test it on some sample data!