Home » SQL & PL/SQL » SQL & PL/SQL » lock record
lock record [message #39339] Mon, 08 July 2002 23:34 Go to next message
iyad ahmad
Messages: 1
Registered: July 2002
Junior Member
there is any way to lock one record in a table,
I want to use select for update to lock just one record. How can I do that?
Re: lock record [message #39342 is a reply to message #39339] Tue, 09 July 2002 05:34 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
declare cursor with 'for update' clause.oracle internally locks that record when you open that cursor and fetches.

example:

declare
cursor c1 is select * from emp where empno=1223 for update;
crec c1%rowtype;
begin
open c1;
fetch c1 into crec;
...

end;
Previous Topic: Help with PL/SQL
Next Topic: help with 3 tables
Goto Forum:
  


Current Time: Fri Apr 26 06:30:16 CDT 2024