471,887 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

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
------------------------------ --------- ------------------ --------
----- -----
0 Yes
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)
------------------------ ------------------------
+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.

Nov 12 '05 #1
0 3989

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 YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.