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 

SQLCODE when using COUNT(*) for a Table

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


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Fri Apr 13, 2007 6:29 am    Post subject: SQLCODE when using COUNT(*) for a Table Reply with quote

Hi all,

I have query as shown below....

SELECT COUNT (*)
FROM TABLE1
WHERE COL1 = '123';

Does anybody know what will be SQLCODE for this query if COUNT = 3.
And when SQLCODE will be 0 for the above query...



Thanks
Suma
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Apr 13, 2007 6:52 am    Post subject: Reply with quote

Is that using Spufi or in a program?
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Fri Apr 13, 2007 6:53 am    Post subject: Reply with quote

I am using it in a COBOL program.....In SPUFI I am getting SQLCODE as 100
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Apr 13, 2007 6:54 am    Post subject: Reply with quote

yes - in spufi you will get +100 but in your program you SHOULD get 000
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Mickeyd
Beginner


Joined: 02 Jan 2003
Posts: 27
Topics: 0

PostPosted: Mon Apr 16, 2007 12:44 pm    Post subject: Reply with quote

In COBOL for the count you will get a zero, you have to check the count field
in order to determine if you have any data that matched your count query.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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