ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » problem with float values in the esql

Post new topic  Reply to topic
 problem with float values in the esql « View previous topic :: View next topic » 
Author Message
sachinramesh
PostPosted: Thu May 29, 2008 2:36 am    Post subject: problem with float values in the esql Reply with quote

Disciple

Joined: 20 Feb 2007
Posts: 170

Hi

I am having an esql code which is doing a simple division

when i checked the code in debugging it is dividing the values

-2579250.20 with 2 and
giving the result -1289625.1

But while inserting the same value in the database it is inserting as
-1.289625E+6 and is throwing an error

ERROR: [IBM][CLI Driver] CLI0111E Numeric value out of range. SQLSTATE=22003

The datatype of the variable is declared as float

and in the database the field is a decimal datatype and of length 8 .

Why is it happening like that.
Back to top
View user's profile Send private message Send e-mail
Gaya3
PostPosted: Thu May 29, 2008 2:44 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

length 8 is very less, increase it and test it once again.


Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
sachinramesh
PostPosted: Thu May 29, 2008 3:13 am    Post subject: Reply with quote

Disciple

Joined: 20 Feb 2007
Posts: 170

Gaya3 wrote:
length 8 is very less, increase it and test it once again.


Regards
Gayathri


Thanks Gayatri its working fine now
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Thu May 29, 2008 3:42 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
The datatype of the variable is declared as float
and in the database the field is a decimal datatype and of length 8 .


Why use a float in ESQL if the data in the DB is decimal? If will be more accurate to use decimal in ESQL as well.
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
sachinramesh
PostPosted: Thu May 29, 2008 4:12 am    Post subject: Reply with quote

Disciple

Joined: 20 Feb 2007
Posts: 170

mgk wrote:
Quote:
The datatype of the variable is declared as float
and in the database the field is a decimal datatype and of length 8 .


Why use a float in ESQL if the data in the DB is decimal? If will be more accurate to use decimal in ESQL as well.


hi mgk

Thanks for your suggestion i changed it to decimal and now it is workng perfectly...
Before(after changing the cloumn lenght to 15) it was inserting the value as-1289625.0000 instead of -1289625.1
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » problem with float values in the esql
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.