If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Strange SQL +100 Warning

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-09-04, 15:42
Grumpy Grumpy is offline
Registered User
 
Join Date: Jan 2004
Posts: 9
Strange SQL +100 Warning

Hi -anyone here ever seen an SQL +100 Warning when performing SELECT COUNT(*)? - I'm very familiar with +100 warnings (i.e. no rows found) but this is a strange case since for a SELECT COUNT(*) one should simply receive a count of zero with a normal return code if no rows match the WHERE criteria. We do have a sub SELECT within the WHERE - could that do it?

What's really strange is that the query runs fine from SPUFI / DB2 Command Center - but in the binded module it receives this error.

We're on DB2 V7.

Thanks for the help!

Last edited by Grumpy; 02-09-04 at 15:44.
Reply With Quote
  #2 (permalink)  
Old 02-09-04, 23:13
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I ran the following query using the CLI on DB2 V8 for Linux:

select * from employee
where edlevel =
(select count(*) from employee where lastname ='xxx')

I got no rows back and return code of +100

If I just run the subquery portion by itself, I get "0" back with return code of 0.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 02-10-04, 05:38
hanyheggy hanyheggy is offline
Registered User
 
Join Date: Jan 2004
Location: Egypt
Posts: 61
in all cases SQLCODE 100 should be handled in the program, so u can set the number of rows returned to 0
__________________
hany heggy,
IBM certified Professional, AIX system support
www.melodyhits.tv
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On