Row Level Lock, can you force one without updating a row, is there a way to lock a row that is just being viewed(selected) in the app?
SMD
Printable View
Row Level Lock, can you force one without updating a row, is there a way to lock a row that is just being viewed(selected) in the app?
SMD
SELECT ...
FROM ...
FOR UPDATE;
This select statement does a row level lock.
Roger
in my testing this locks the whole table
I only want to lock the specific row that I am looking at.
Is there a way to do this?
SM
If you don't use any WHERE predicate in your SELECT FOR UPDATE, then of course all rows in a table will be locked (but this still doesn't mean the table is locked, it is very different as to ALTER TABLE LOCK command).Quote:
Originally posted by supermega
in my testing this locks the whole table
I only want to lock the specific row that I am looking at.
Is there a way to do this?
SM
SELECT * FROM dept WHERE deptno = 10 FOR UPDATE; will lock only one row in a table.