View previous topic :: View next topic
|
Author |
Message |
themants
New User
Joined: 11 Aug 2022 Posts: 9 Location: india
|
|
|
|
The db2 table consists of multiple matching records. I want to display 10 records on a page for a frontend screen at a time. If user goes for next page, then next 10 records from a table needs to be displayed. I want to perform this in a loop using cursor.
Please advise how should i define a logic in cursor and loop. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
This is a HELP forum, not a WRITE-THE-CODE-FOR-YOU forum. Once you've worked out the logic you need, if you have problems then you can post what the issue(s) are. But until then, we're not writing your code (or logic). |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Welcome!
Since your first post I would volunteer to provide one of the approach below but going forward please try and post errors or issues to get help.
Optimized way-
Fetch and write to a TSQ until end of cursor
Next perform a loop 10 times or end of TSQ
Read TSQ and build mapout symbolic fields.
Send map at the end of the loop.
Using item# of first and last record out of 10 ,you can control your paging logic on TSQ.
Try to write a code on this information and if you get any issues then post us back as suggested. |
|
Back to top |
|
|
|