Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Updating records of a PL/SQL cursor

3673816Jan 17 2019 — edited Jan 17 2019

Hello forum.

I have a pl/sql cursor on a table.

As I loop through each record of the cursor, I need to update some columns in that record. I do that. Then I commit.

When I loop through the next record of the cursor, I need to environment to be aware of the updates I made in the previous iteration of the loop (step above).

My understanding is that opening a cursor is like capturing a snapshot of the data in memory. I can update the record I am looping through itself either via the ROWID or with the CURRENT OF clause, but I don't think my next iteration of the loop will be aware of the change I made in the previous iteration, because it reads the snapshot of the data that was taken when the cursor was first opened (i.e. before I made the update in the previous iteration).

Is there a way to make this work?

Thank you

Boris

Comments
Post Details
Added on Jan 17 2019
3 comments
10,739 views