IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Scrollable Cursor Syntax


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Taurus

New User


Joined: 04 Jan 2013
Posts: 3
Location: India

PostPosted: Fri Jan 04, 2013 7:33 pm
Reply with quote

I am in need of a Scrollable Cursors syntax

Requirement:
There is a Web services program which fetches data using a cursor(Cobol DB2 program) and displays on an HTML front end screen

There was a limit of maximum 500 rows to be displayed considering that its a very complex SQL statement within the cursor and would affect the system performance.

I am now changing the program to give an option to the users to navigate all rows by providing a next and prev buttons in the screen(screen changes are easy)

What I would like to do now is write a statement(modify the existing cursor or whatever) that allows the cursor to be able to navigate to the next set of rows(initially it shows 500 only rows(there is a fetch first 500 rows only statement). When the user clicks next he should get 501 - 1000 and so on) when the next option is clicked selects a specific number of rows (in my case 500).

I would like to link it to a web page that uses the keys < > to scroll though the first 500 records in the table and then the next 500 forward or back, until it hits the end of the rows.

I need examples statements of the Cursor syntaxes as to how this could be achieved.

I hope this explains the situation somewhat. If you require more information, I could supply it. If you can help or give ideas or examples that would be great.


Cheers
Taurus
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Jan 04, 2013 10:42 pm
Reply with quote

But why do you need a scrollable cursor?

Is it particular to achieve it using scrollable cursor?
Back to top
View user's profile Send private message
Taurus

New User


Joined: 04 Jan 2013
Posts: 3
Location: India

PostPosted: Mon Jan 07, 2013 2:18 pm
Reply with quote

Hello,
It is not a mandate that I need to use Scrollable cursors, but I thought that this would be the best/simplest way to achieve this solution


Cheers
Taurus
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Jan 07, 2013 4:58 pm
Reply with quote

What release of DB2 you are at? (pressuming DB2 7 and higher)

This is from DB2 8: (Out of service and I leave the exercise to find the IBM documentation for your release of DB2)

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2.doc.apsg%2Fqscroll.htm

An article you might be interested in: searchdatamanagement.techtarget.com/answer/How-and-when-to-use-DB2-scrollable-cursors
Back to top
View user's profile Send private message
Taurus

New User


Joined: 04 Jan 2013
Posts: 3
Location: India

PostPosted: Mon Jan 07, 2013 5:03 pm
Reply with quote

Hello Anuj,
Thanks for taking time, I currently am on the Version 7. I found some interesting stuff which can be used on version 8 unfortunately I cannot use that icon_sad.gif

Cheers
Taurus
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts CNTL= Command Syntax Documentation CA Products 3
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
This topic is locked: you cannot edit posts or make replies. issue with Syntax error SYNCSORT 2
No new posts Restart logic by using cursor name in... DB2 1
Search our Forums:

Back to Top