IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQLCODE = -419 & SQLSTATE = 42911


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
GOWTHAM PAINENI

New User


Joined: 16 Aug 2011
Posts: 7
Location: USA

PostPosted: Sat Oct 08, 2011 5:04 am
Reply with quote

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
View user's profile Send private message
GOWTHAM PAINENI

New User


Joined: 16 Aug 2011
Posts: 7
Location: USA

PostPosted: Sat Oct 08, 2011 5:18 am
Reply with quote

Here USEDQTY & BIDQTY both are of data type DECIMAL(13,4).
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Oct 08, 2011 8:07 am
Reply with quote

Google swg21214415.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts SQLCODE = -122 while using the scalar... DB2 4
No new posts SQLCODE = -16002 when using XMLEXISTS DB2 1
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts SQLCODE=-204 SQLSTATE=42704 DB2 4
No new posts Getting sqlcode 805 while executing R... DB2 10
Search our Forums:

Back to Top