Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question.

Asked: August 27, 2020 - 12:51 pm UTC

Last updated: August 27, 2020 - 2:42 pm UTC

Version: Oracle 12 c

Viewed 1000+ times

You Asked

HI Tom,
There are two users say A,B. Both of them are trying to update same record and same column name (in same time) say %hike in salary.Any one of user updated
successfully, we should allow the other user to update again.How to achieve this.

Regards,
Karthik.

and Chris said...

we should allow the other user

You should or should NOT? I suspect the latter.

If so, you'll need to stop the second update writing after the first. Typically you do this using a form of optimistic locking control. Essentially when running an update, you check that nothing's changed since the user selected the row to modify.

You can read more about how to do this at:

https://asktom.oracle.com/pls/apex/asktom.search?tag=locking-mechanism

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.