Oracle for update usage

Source: Internet
Author: User

Oracle does not lock data if only select is used in Oracle. When the data is being modified by another process, the results obtained by using Select are not up to date.

This requires a for update, and when Oracle finds that a record that satisfies the condition is being updated, it does not execute the SELECT statement immediately, but waits until the end of the update to execute the SELECT statement.

There are two other ways to use it:

For UPDATE nowait: When Oracle discovers that a record that satisfies a condition is being updated, it throws an exception instead of waiting, and we catch an exception in the program to understand what is going on and take appropriate exception handling.

For update wait 3: When Oracle discovers that a record that satisfies the criteria is being updated, it waits until the update is over 3 seconds and throws an exception.

Oracle for update usage

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.