Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Informix Row Locking 1

Status
Not open for further replies.

BBanks

Programmer
Dec 29, 2003
1
US
I need to modify our application so that when a user accesses "record #1", that record is locked and any other user is prevented from viewing (selecting) that record until user #1 is done with it.

Can someone please advise me on how to accomodate this? I assume I can do it with locking somehow.

Thanks!

Bob
bbanks@longs.com
 
SELECT field1, field2 from yourtable where yourkey = 'key' for update;

using cursors, or

just
begin;
update yourtable
set dummfield = 1
where yourkey = 'key';
<< do your work >>
commit; release lock



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top