In SQL Server I used the following hints inside queries:
- rowlock (row level locking)
- updlock (prevents dirty reads)
- readpast (don’t block waiting for a rowlock, go to the first unlocked row)
e.g.
select top 1 data from tablez with (rowlock,updlock,readpast);
Are there equivalent in-query hints for Oracle?
The equivalent of
ROWLOCKis theFOR UPDATEclauseSince 11g Oracle has documented the
SKIP LOCKEDsyntax which is the equivalent ofREADPAST:This syntax has worked for ages (it is fundamental to Advanced Queuing) but if it’s not in the docs it’s not supported,
There is no equivalent of
UPDLOCKlock because Oracle flat out doesn’t allow dirty reads. Find out more.