MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Querying a float defined number

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
cappertan
Beginner


Joined: 20 May 2003
Posts: 15
Topics: 10

PostPosted: Thu Aug 12, 2004 9:58 am    Post subject: Querying a float defined number Reply with quote

Hi:

1. I am trying to run this query:
WHERE A.PAT_ID > ' '
AND A.PAT_ID = B.PAT_ID
AND BP_SYSTOLIC > 0

I get a systax error of :
DSNE610I NUMBER OF ROWS DISPLAYED IS 0
DSNT408I SQLCODE = -413, SQLSTATE = 22003, DATA EXCEPTION FROM OS/2.

2. Then I tried:
WHERE A.PAT_ID > ' '
AND A.PAT_ID = B.PAT_ID
AND DECIMAL(BP_SYSTOLIC) > 0

I get same. systax error of :
DSNE610I NUMBER OF ROWS DISPLAYED IS 0
DSNT408I SQLCODE = -413, SQLSTATE = 22003, DATA EXCEPTION FROM OS/2.

BP_SYSTOLIC is defined as a float. The database is UDB and I am
using DB2 Spufi to do the query.

What am I doing wrong
_________________
Capp
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Aug 12, 2004 10:28 am    Post subject: Reply with quote

Cappertan,

Are you performing any calculations with the BP_SYSTOLIC field? You are getting that error because an overflow occured due to numeric data conversion.

check this link for a detailed explanation of sql code -413

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNMCH11/2.1.6.142?SHELF=&DT=20010718150520&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cappertan
Beginner


Joined: 20 May 2003
Posts: 15
Topics: 10

PostPosted: Thu Aug 12, 2004 10:35 am    Post subject: Reply with quote

Kolusu:

No calculations. Just trying to find rows where this is greater than 0.
I tried NOT Null but got the same error. Will check the IBM site.
_________________
Capp
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Aug 12, 2004 10:40 am    Post subject: Reply with quote

cappertan,

Post your complete SQL. Also post the defintion of the column

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cappertan
Beginner


Joined: 20 May 2003
Posts: 15
Topics: 10

PostPosted: Thu Aug 12, 2004 10:50 am    Post subject: Reply with quote

Column Definition:
COLNO COLTYPE LENGTH
------+---------+------
12 DOUBLE 8


Entire query:

***************************** Top of Data **
SELECT A.PAT_ID,
DECIMAL(BP_SYSTOLIC,3) AS BP_SYS
FROM HCCLCO.PAT_ENC A, HCCLCO.IDENTITY_ID B
WHERE A.PAT_ID > ' '
AND A.PAT_ID = B.PAT_ID
AND DECIMAL(BP_SYSTOLIC) > 0
ORDER BY UPDATE_DATE DESC
_________________
Capp
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Aug 12, 2004 11:05 am    Post subject: Reply with quote

cappertan,

Your decimal function is having a precision of only 3 digits. Increase it to a bigger value so that it will accomadate the value of BP_SYSTOLIC.
Code:

SELECT A.PAT_ID
      ,DECIMAL(BP_SYSTOLIC,31) AS BP_SYS
  FROM HCCLCO.PAT_ENC     A
      ,HCCLCO.IDENTITY_ID B
WHERE A.PAT_ID             > ' '
  AND A.PAT_ID             = B.PAT_ID
  AND DECIMAL(BP_SYSTOLIC) > 0
ORDER BY UPDATE_DATE DESC


Hope this helps...

cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group