Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7619509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:42:18+00:00 2026-05-31T03:42:18+00:00

In Oracle SQL update statement, assuming the update would affect 5 rows, does the

  • 0

In Oracle SQL update statement, assuming the update would affect 5 rows, does the update statement updates all 5 rows concurrently or sequentially? E.g.

UPDATE table1 
set column2 = 'completed' WHERE
index between 1 AND 5

In the above statement, would index 1 to 5 be updated in sequence, i.e. 1, 2, 3, 4 then 5, or would it occur concurrently (1-5 all at once).

I had referred to Oracle documentation but it seems that nothing is mentioned on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:42:19+00:00Added an answer on May 31, 2026 at 3:42 am

    After the UPDATE statement has executed, the effects of the statement will become visible to the rest of the transaction (and if you commit, to other transactions). In what order will Oracle physically do it, is an implementation detail (similarly how the order of SELECT result is not guaranteed unless you specify ORDER BY).


    In most cases, this order does not matter to the client. One case where it might is to avoid deadlocks with another transaction that is updating the overlapping set of rows. UPDATE will lock the row being updated until the end of the transaction, so if two transactions try to lock the same rows, but in different order, a deadlock may ensue.

    The standard way of avoiding deadlocks is to always lock in a well-defined order. Unfortunately, UPDATE does not have the ORDER BY clause, but you can do this:

    SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
    SELECT ... WHERE condition ORDER BY ...  FOR UPDATE;
    UPDATE ... WHERE condition;
    COMMIT;
    

    Where condition is same for both statements. The serializable isolation level is necessary for WHERE to always see the same set of rows in both statements.

    Or, in PL/SQL you could do something like this:

    DECLARE
        CURSOR CUR IS SELECT * FROM YOUR_TABLE WHERE condition ORDER BY ... FOR UPDATE;
    BEGIN
        FOR LOCKED_ROW IN CUR LOOP
            UPDATE YOUR_TABLE SET ... WHERE CURRENT OF CUR;
        END LOOP;
    END;
    /
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following Oracle statement: DECLARE ID NUMBER; BEGIN UPDATE myusername.terrainMap SET playerID = :playerID,tileLayout
I have a PL/SQL function (running on Oracle 10g) in which I update some
I am using Oracle SQL (in SQLDeveloper, using the SQL Worksheet). I would like
I'm using following update or insert Oracle statement at the moment: BEGIN UPDATE DSMS
Oracle SQL Developer allows you to update field values directly to the table without
I've been asked to convert this statement from PL/SQL to SQL Server: UPDATE pdi_nb_process_complete
I have an application that uses the Oracle MERGE INTO... DML statement to update
Using Delphi 7, BDE, and Oracle I perform a SQL select statement and then
I would like to verify that the sql query I'm sending to Oracle is
I am trying to create an update statement in Oracle. Here it is version

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.