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 

row numbers in stored procedures

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


Joined: 02 Jun 2003
Posts: 1
Topics: 1

PostPosted: Mon Jun 02, 2003 10:55 pm    Post subject: row numbers in stored procedures Reply with quote

HI

I am writing a Stored Procedure(cobol,DB2 V7.1) to implement a search operation in database Java based front end will call this procedure.

The requirement is if the search criteria returned more than 100 rows the screen will display only 100 rows and when user pressing next button the next 100 rows??? should display.

So I have to implement query to get 1st hundred rows, second hundred rows,so on... depending on the parameters passed from front end.

In oracle there is a concept of row numbers to achieve this.

Can anybody give a way to solve this issue
Thanks in Advance
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Wed Jun 25, 2003 2:22 pm    Post subject: Reply with quote

You can call the stored procedure 2 times for the first and second set of 100 rows. The 2nd time you call the stored procedure, you can use a greater than WHERE clause to return only records whose key is greater than the key of the last record you have displayed on the screen.
Have a look at th following link which discusses a similar kind of problem -
http://www.mvsforums.com/helpboards/viewtopic.php?t=118

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
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