# Databases > Oracle Lock in Oracle Tables

## sripri

If there is no lock specified what is the default lock that would be present in Oracle tables? Why I ask this is if two users try to update the same table is it that user has to explicitly provide locking for preventing concurrent updates or it is taken care of internally by default.

----------


## jamesravid

Updated records are locked implicitly in Oracle until the user who updated the records ends the transaction.
 You can lock records explicitly in oracle by using *select...for update* clause.

Regards,
James.

----------


## ily_saravanan

> If there is no lock specified what is the default lock that would be present in Oracle tables? Why I ask this is if two users try to update the same table is it that user has to explicitly provide locking for preventing concurrent updates or it is taken care of internally by default.




Hi,
  First you have to lock the rows explicitly before some body update the rows
like below query

select * from table name
for update no wait;

use the above command to prevent other user from updating. but u can issue the dml command. locked rows will be released only when u commit or rollback the transaction

----------


## sripri

Thanks you friends. I tried my hands on locking as suggested by you with the ideas given in this discussion and could get a complete idea on it.

----------

