View previous topic :: View next topic |
Author |
Message |
prog_mario Beginner
Joined: 08 Sep 2007 Posts: 86 Topics: 27
|
Posted: Wed Oct 20, 2010 2:18 pm Post subject: How to avoid cursor to reflect changes made in target table. |
|
|
My cursor (COBOL PROG):
Code: |
EXEC SQL
DECLARE C1 CURSOR WITH HOLD FOR
SELECT ROW_A
,ROW_B
,ROW_C
FROM TABLE_A
END-EXEC
|
During the process I might insert rows into TABLE_A but those rows can not appear in my cursor when I fetch it.
I need it WITH HOLD because I have to commit the inserts and maintain the cursor opened.
I don't want to use timestamp as a flag in the WHERE clause.
Any help.
Thanks a lot.
:( |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Oct 20, 2010 3:32 pm Post subject: |
|
|
prog_mario,
Change the cursor definition to INSENSITIVE SCROLL CURSOR which will have the following effect
The size, the order of the rows, and the values for each row of the result table do not change after the application opens the cursor.
Read about it here
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnapj12/2.2.3.1.2
Kolusu |
|
Back to top |
|
 |
prog_mario Beginner
Joined: 08 Sep 2007 Posts: 86 Topics: 27
|
Posted: Wed Oct 20, 2010 4:58 pm Post subject: |
|
|
Thanks a lot Kolusu. Always helping us. Many many thanks. _________________ The more I learn, the more I want to learn. |
|
Back to top |
|
 |
|
|