Hi Trafodioneers,

I tried to cast float value 123.4 to varchar, but the output format is 
scientific notation format. Is it by design? I think if the output 123.4 is 
better, agree?

SQL>create table test7( a float);
SQL>insert into test7 values(123.4);
SQL>select * from test7;

A
------------------------
                   123.4
SQL>select cast(a as varchar(30)) from test7;

(EXPR)
------------------------------
1.23400000000000000E+002

SQL>select cast(a as varchar(9)) from test7;

(EXPR)
---------
1.2E+002

--- 1 row(s) selected.

SQL>select cast(a as varchar(8)) from test7;

*** ERROR[8402] A string overflow occurred during the evaluation of a character 
expression. Conversion of Source Type:IEEE DOUBLE PRECISION(REC_IEEE_FLOAT64) 
Source Value:1.23400000000000000E+002 to Target Type:VARCHAR(REC_BYTE_V_ASCII). 
[2017-12-12 11:55:47]


Best regards,
Yuan

Reply via email to