By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,851 Members | 1,668 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,851 IT Pros & Developers. It's quick & easy.

DB2 Cursor Issue

P: 1
I have two DB2 cursors accessing the same tabel but in adifferent order.

I open the first one, fetch all the data, Then close it.

When I open the second one with the new order, it starts at the last row of the first cursor. I even tried doing a commit to see if it would clear but it doesn't.

How can I get the second cursor to start at the first row in the new order?

Thanks
below are the definitions of the two cursors:
EXEC SQL
DECLARE NUM-ACCT-CURSOR CURSOR FOR
SELECT NUM_OFFICE
,NUM_ACCT
,KEY_TMS
FROM TCLIENT
WHERE NUM_OFFICE <= 799
ORDER BY NUM_OFFICE, NUM_ACCT
WITH UR
END-EXEC.

EXEC SQL
DECLARE KEY-TMS-CURSOR CURSOR FOR
SELECT NUM_OFFICE
,NUM_ACCT
,KEY_TMS
FROM TCLIENT
WHERE NUM_OFFICE <= 799
ORDER BY KEY_TMS
WITH UR
END-EXEC.
Oct 5 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.