Wednesday, August 12, 2020
dbametrix
More
    Home Oracle DBA Tips select for update

    select for update

    sql tutorial, learn sql

    Hi friends,

    - Advertisement -
    dbametrix

    Today we discuss SELECT FOR UPDATE characteristics.

    By default, the Oracle RDBMS locks rows as they are changed by any updated statement. To lock all rows in the result set,  use the for update clause in your select statement when you open the cursor, instead of when you change the data. Using the FOR UPDATE clause does not necessitate you to essentially construct changes to the data; it merely locks the rows when opening the cursor. These locks are released on the next commit or rollback. As always, these row locks don’t affect other select statements unless they, too, are FOR update. The FOR UPDATE clause is appended to the end of the SELECT statement and has the following syntax.

    Command Syntax:

    select from … for update [column reference] [NOWAIT];

    Where column reference is a comma-delimited list of columns that appear in select clause. The NOWAIT keyword tells the RDBMS to not wait for other blocking locks to be released. The default is to wait forever and it is more problematic.

    - Advertisement -
    dbametrix

    Generally, SELECT FOR UPDATE is the best solution for blocking lock problem. But it is not good for every time.

    A new Discussion Board of Oracle is established by Dbametrix for helping and give assistance for fresher Oracle job, how to earn money, and Oracle troubleshooting. Kindly join and share the knowledge.

    Thanks and regards,

    Expert Database Administration

    Online Oracle courses

    Latest IT news

    0
    - Advertisement -
    dbametrix
    - Advertisment -
    dbametrix

    Most Popular

    ASM Disk creation issue

    The article explains how to troubleshoot Oracle ASM disk creation. Solution of Oracle ASM disk creation with ASMLIB

    Oracle Tuning Basics Part-2

    This is the 2nd part of Oracle database tuning basics including depth of every aspects.

    Oracle Tuning Basics Part-1

    The article explains Oracle database performance tuning basics details.

    When you finding new job

    The article guides you 10 things to remember when you are searching a new job to improve yourself including skills and better growth for every DBA.

    Recent Comments

    Gordon Coleclough on Oracle Tuning Basics Part-1
    Gordon Coleclough on ASM Disk creation issue