colintobing
colintobing

Reputation: 167

Convert Exponential to Varchar in Netezza

I have this 12241089001 value read as 1.2241089001E10 in Netezza. Actually the data type is Varchar. How can this read as exponential? When I convert 1.2241089001E10 into Varchar, it's only cut the E10. Example : 1.2241089001. How to save this value into 12241089001?

Upvotes: 0

Views: 923

Answers (1)

ScottMcG
ScottMcG

Reputation: 3887

A direct CAST from VARCHAR to FLOAT or NUMERIC should do the trick.

TESTDB.ADMIN(ADMIN)=> select '1.2241089001E10'::float;
  ?COLUMN?
-------------
 12241089001
(1 row)

TESTDB.ADMIN(ADMIN)=> select '1.2241089001E10'::numeric(38,10);
        ?COLUMN?
------------------------
 12241089001.0000000000
(1 row)

Upvotes: 1

Related Questions