View previous topic :: View next topic |
Author |
Message |
ironponygrl Beginner
Joined: 22 Mar 2013 Posts: 21 Topics: 7 Location: Fort Worth, TX
|
Posted: Thu Mar 27, 2014 3:02 pm Post subject: fetching a DB2 cursor into a working storage table |
|
|
i'm working on a legacy mainframe system written in COBOL, CICS and Natural. I find many places in this old system where a cursor is opened then fetched into a working storage table and closed. Usually its not a lot of data, just like all the rows for a single individual. is there still a reason to do this kind of processing? doesnt scrollable cursors take care of any previous issues? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Mar 27, 2014 3:44 pm Post subject: |
|
|
ironponygrl,
If you are reading the data from the cursor and moving into a working storage table then I think it has to do with LOCKS and avoiding deadlocks. You probably are working with the uncommitted data in your working storage. If it is a batch process, I believe you quickly fetch the data from the table usually at midnight and then release the lock so that other applications or online systems can perform their updates.
Having said if you just want to read the uncommitted data, you can get around it by simply specifying WITH UR on the cursor. |
|
Back to top |
|
|
ironponygrl Beginner
Joined: 22 Mar 2013 Posts: 21 Topics: 7 Location: Fort Worth, TX
|
Posted: Fri Mar 28, 2014 11:53 am Post subject: |
|
|
thanks K, I think that whats going on is just really old technique that can be accomplished in another way |
|
Back to top |
|
|
|
|