If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > set cursor and fetch 10 rows after cursurposition

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-14-04, 08:15
smudo smudo is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
set cursor and fetch 10 rows after cursurposition

Hi there!

i'm new to DB2-Sql and i have a small problem.

i want to set the cursor on a specific position in my table and read 10 records.

Can anybody help me to find a solution.


regards Smudo
Reply With Quote
  #2 (permalink)  
Old 01-14-04, 08:37
N-ary N-ary is offline
Registered User
 
Join Date: Oct 2003
Posts: 87
DECLARE CURSOR eee AS
SELECT * FROM aaa.bbb WHERE ccc => :ddd
set :ddd = :fff
OPEN CURSOR eee
FETCH CURSOR eee INTO ggg <ten times>

Not keeping up real well on DB2 SQL, anyway, there may be a new construct for cursors in DB2 that would allow first going to ddd and then filling a matrix/table with the next 9 rows as well.
Something like this
FETCH CURSOR eee INTO ggg FOR 10 ROWS
__________________
Oracle - DB2 - MS Access -
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On