469,579 Members | 1,102 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

Double datatype value display in select statament

Hey All,

I have a small problem. consider the following
db2 "create table ttt (mynum float, yournum double )" DB20000I The SQL command completed successfully.
db2 "describe table ttt"
Column Type Type
name schema name Length
Scale Nulls
------------------------------ --------- ------------------ --------
----- -----
MYNUM SYSIBM DOUBLE 8
0 Yes
YOURNUM SYSIBM DOUBLE 8
0 Yes

2 record(s) selected.
db2 "insert into ttt values (1234567890.123456, 1234567890.123456)" DB20000I The SQL command completed successfully.
db2 "select mynum, yournum from ttt" #(QUERY 1)
MYNUM YOURNUM
------------------------ ------------------------
+1.23456789012346E+009 +1.23456789012346E+009

1 record(s) selected.
db2 "select decimal(mynum, 17,6), decimal(yournum, 17,6) from ttt"

#(QUERY 2)

1 2
------------------- -------------------
1234567890.123456 1234567890.123456

1 record(s) selected.
Now, the displayed values from the simple select, and the decimal()
based select, are not the same, although mathematically they both are
the same (I am not good at maths, so I will speak of them as SAME.
some of you extreme mathematicians may not agree with me!!). I want to
display the result of query number 2 by running query number 1, i.e.
by NOT using any math function on the table columns, and still be able
display the actual *numbers* of the columns. How is it possible in
DB2. I am running DB2 UDB 7.2 FP7 on a Windows Platform.

Thanks,
dotyet
Nov 12 '05 #1
0 3957

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by abdul_n_khan | last post: by
14 posts views Thread by cj | last post: by
5 posts views Thread by hello | last post: by
3 posts views Thread by mrajanikrishna | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.