I saw this post from 3 years ago regarding converting DOUBLE values to
CHAR in ibm DB2. Now I'm having the same problem. No real solution
was posted to that old thread. Has anyone got more information how I
avoid the scientific notation when I use the CHAR() function to
convert a DOUBLE or FLOAT ? What I want is "MagicFunction" in the
following pseudocode:
myVarchar = MagicFunction(123.0003);
print myVarchar -> outputs "123.0003"
myVarchar = MagicFunction(2);
print myVarchar -> outputs "2"
Thanks,
Kent Lewandowski
---
Have you tried casting to BIGINT or the largest possible DEC?
Dmitry wrote:
I have large double numbers, so int() and dec() functions return 0. Any
other way?
Thank you,
Dmitry.
"Blair Kenneth Adamache" <ad******@ca.ibm.com> wrote in message
news:3B***************@ca.ibm.com...You could cast it to an int, dec or a char. Casting to a numeric value (INT or
DEC) makes more sense:
db2 export to c:\tmp\chard.asc of del select
substr(char(col1),1,1) from testdoub
db2 export to c:\tmp\chari.asc of del select
int(col1) from testdoub
Dmitry wrote:Hi,
When I export table to text file (using db2 export command) I get scientific
notation for double values like +1.18086063594092E-006.
Does anybody know how to avoid the E-006 part? I use DB2 v6.1 on Win2000.
Best regards, Dmitry.