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!

loop without lock

Ricky007Dec 27 2019 — edited Dec 27 2019

Dear Experts

I am having summary table which I need to reset to 0  on every week by jobs

I had scheduled job with simple dml statement

update sumy_tb set week_amt=0;

but it is not updating for few records due to transaction occurs during that time.

Please help me to update a statement until all the values in the column set to 0 without locking.

Here is the statement i am trying,But it locking during scheduler run

BEGIN

      FOR I IN (SELECT week_amt FROM sumy_tb)

     LOOP

        UPDATE sumy_tb SET week_amt=0;

      END LOOP;

END; 

Please help

This post has been answered by BEDE on Dec 27 2019
Jump to Answer
Comments
Post Details
Added on Dec 27 2019
2 comments
344 views