Teradata Trim Function @ Conversion of SQL Server Query to Teradata Query

Database
Enthusiast

Teradata Trim Function @ Conversion of SQL Server Query to Teradata Query

Hello everyone;

I'm sorry. I'm disturbing your. I have a question about conversion of SQL Server Query to Teradata Query about TERADATA TRIM  function.

If anyone can help me in conversion of query to teradata;

select

case when len(isnull(rtrim( ColumnName),0)) <10 then '0'  else coalesce ( ColumnName , 0 ) end 

Thanks in advance...

Ismail Arslan

3 REPLIES
Junior Contributor

Re: Teradata Trim Function @ Conversion of SQL Server Query to Teradata Query

Hi Ismail,

rtrim(x) -> trim(trailing from x)

len -> char_length

isnulll -> coalesce

This seems to be a strange calculation:

Cast a numeric value to a string and then calculate the number of digits in it, if it's less than 10 return zero?

Isn't this the same as:

case when columnname > 10000000000 then columnname else 0 end

Dieter

Enthusiast

Re: Teradata Trim Function @ Conversion of SQL Server Query to Teradata Query

thanks.

 I will try and get back you.

Enthusiast

Re: Teradata Trim Function @ Conversion of SQL Server Query to Teradata Query

thanks Dieter