Wednesday, October 28, 2020
    Home Oracle DBA Tips select for update

    select for update

    sql tutorial, learn sql

    Hi friends,

    - Advertisement -

    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 -

    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

    - Advertisement -
    - Advertisment -

    Most Popular

    Five Reasons Why Database Outsourcing

    The blog post explains why database outsourcing and remote dba support becomes most popular during present time of Covid-19 Pandemic.

    Hardware of Database Server

    The blog post explains how to choose best hardware of your database server for getting high performance and security.

    oracle 19c new features – Automatic Indexing

    A major Oracle 19c autonomous database new Feature automatic indexing using DBMS_AUTO_INDEX some details and how to article.

    Differences Raw Device, ASM Device and CFS

    The article explains basic differences of ASM device, raw device and Oracle cluster file system cfs with fundamentals

    Recent Comments