View previous topic :: View next topic |
Author |
Message |
rose Beginner
Joined: 02 Jun 2003 Posts: 1 Topics: 1
|
Posted: Mon Jun 02, 2003 10:55 pm Post subject: row numbers in stored procedures |
|
|
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 |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Wed Jun 25, 2003 2:22 pm Post subject: |
|
|
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 |
|
|
|
|