Link to home
Start Free TrialLog in
Avatar of GurcanK
GurcanK

asked on

PL/SQL for Updates with Frequent Commit

Dear Experts,

I'm very new to PL/SQL. I want to write a procedure to update a table. The table TA fas fields (x number, y varchar(20)) and want to update field y with value 'xyz' if it is null. However since there are hundreds of millions of records with this condition, I would like to use cursors and commit after each update of 1.000 record.

Could you please help me?  

Best Regards
Avatar of ste5an
ste5an
Flag of Germany image

Even then you should ask the DBA prior to that. Cause even batch updating may be a problem with a small table space.
Avatar of GurcanK
GurcanK

ASKER

That's OK, I talked to DBA.
you'll probably want to commit in larger batches in order to reduce run time and consume fewer resources.


for something small like that, assuming no triggers, I would probably do 100,000 or more per commit.

basically, do as many as your undo space will allow.
ASKER CERTIFIED SOLUTION
Avatar of johnsone
johnsone
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial