Please explain (format '--(32)9.9(6)')) ?

Database

Please explain (format '--(32)9.9(6)')) ?

Could you please help me to understand the beow statement

 

(format '--(32)9.9(6)'))
and
CAST ((float_column (format '--(32)9.9(6)')) AS VARCHAR(30))
 

What the above statement will do ? what is the purpose/use ?

 

 

  • Decimal format
Tags (1)
2 REPLIES
Highlighted
Teradata Employee

Re: Please explain (format '--(32)9.9(6)')) ?

This is a mix of Teradata-style and ANSI-style CASTs. It is equivalent to

 

CAST (CAST(float_column AS format '--(32)9.9(6)'AS VARCHAR(30))

 

It overrides the default formatting for the column, then uses that format to convert the value to VARCHAR representation - though note that the format could generate up to 40 characters.

Re: Please explain (format '--(32)9.9(6)')) ?

Thanks for the Info Smiley Happy