View previous topic :: View next topic
|
Author |
Message |
GOWTHAM PAINENI
New User
Joined: 16 Aug 2011 Posts: 7 Location: USA
|
|
|
|
Hi,
I'm trying to execute the below mentioned DIVISION in a SELECT statement of my query on a DB2 table. And I'm getting the below error message...
------------------------------------------------------------------------------------
DSNT408I SQLCODE = -419, ERROR: A DECIMAL DIVIDE OPERATION IS INVALID BECAUSE THE RESULT WOULD HAVE A NEGATIVE SCALE
DSNT418I SQLSTATE = 42911 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNXOBFF SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = 910 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
------------------------------------------------------------------------------
Query that I'm trying to execute is :
-----------------------------------------
SELECT
(ROUND((USEDQTY - BIDQTY),4) /ROUND(USEDQTY,4))
FROM TABLE_NAME
;
In my table I've the following values in the USEDQTY & BIDQTY Columns
USEDQTY BIDQTY
100 3.8811
676.3704 35.2593
751.2927 0
3210.675 4.3856
3095.865 0
714.9398 45.024
450.4679 50.8844
239.8908 32.5102
194.7822 36.7367
196.627 41.5124
240.1033 46.9089
Just to validate, I tried to execute the same query by using certain numeric value (say 50) in the denominator part i.e. in place of ROUND(USEDQTY,4), then it is giving results without any issue.
Can any one help me with some inputs on this issue ? |
|
Back to top |
|
|
GOWTHAM PAINENI
New User
Joined: 16 Aug 2011 Posts: 7 Location: USA
|
|
|
|
Here USEDQTY & BIDQTY both are of data type DECIMAL(13,4). |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Google swg21214415. |
|
Back to top |
|
|
|