Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to find no of row selected using decalre cursor for DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
bashir ahmad

New User


Joined: 11 May 2013
Posts: 6
Location: canada

PostPosted: Wed Jul 10, 2013 5:34 am    Post subject: How to find no of row selected using decalre cursor for DB2
Reply with quote

I use decalre cursor for a DB2 table for group of items as follows:

Code:
Item                                    PART#         
1      yyy  zzz    uuu   xxx

2      abc  efg    klm   kkk         
2      abc  efg    klm   LLL       5678   
2      abc  efg    klm   MMM     5679

4      abc  efg    klm   kkk         
4      abc  efg    klm   LLL       5680   
 
5      abc  efg    klm   kkk         
5      abc  efg    klm   LLL       5682   
5      abc  efg    klm   MMM     5684
Code'd

I select group of same Items which has more than two rows having parts# also part no as space is allowed.
Q. After Declare select I want how many required rows selected ???

Any one reply to resolve this iseue thanks. Bashir
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jul 10, 2013 6:06 am    Post subject:
Reply with quote

Hello,

You need to repost showing data that goes with your "requirement".

None of the data posted has more than 2 part#s?

Post the declare cursor. Post the other SQL you are using.

Post the "answer" you want when your process is executed on the improved sample data.

Use the Code tag to preserve alignment and improve readability.
Back to top
View user's profile Send private message
bashir ahmad

New User


Joined: 11 May 2013
Posts: 6
Location: canada

PostPosted: Wed Jul 10, 2013 10:16 am    Post subject: How to get no of row rows selected from DB2 Table
Reply with quote

Hi

How to find how many rows selected while using Declare Cursor for DB2 table for a selected criteria, thanks Bashir
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Wed Jul 10, 2013 12:35 pm    Post subject:
Reply with quote

How about using COUNT(*)
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2060
Location: UK

PostPosted: Wed Jul 10, 2013 1:59 pm    Post subject:
Reply with quote

search the forum for row-count
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts USS: Find and replace string within a... vasanthz All Other Mainframe Topics 5 Thu Aug 02, 2018 4:01 am
No new posts Add Comma to each record until find t... naveensrimf DFSORT/ICETOOL 6 Sat Jul 28, 2018 12:25 am
No new posts RACF- How to find the Last access of ... rahul shanmuganatan All Other Mainframe Topics 7 Thu Jun 21, 2018 3:19 pm
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us