View previous topic :: View next topic |
Author |
Message |
cappertan Beginner
Joined: 20 May 2003 Posts: 15 Topics: 10
|
Posted: Thu Aug 12, 2004 9:58 am Post subject: Querying a float defined number |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
cappertan Beginner
Joined: 20 May 2003 Posts: 15 Topics: 10
|
Posted: Thu Aug 12, 2004 10:35 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Aug 12, 2004 10:40 am Post subject: |
|
|
cappertan,
Post your complete SQL. Also post the defintion of the column
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
cappertan Beginner
Joined: 20 May 2003 Posts: 15 Topics: 10
|
Posted: Thu Aug 12, 2004 10:50 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Aug 12, 2004 11:05 am Post subject: |
|
|
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 |
|
 |
|
|