Re: Row Locking in Stored Procedures
Posted in 1999
Which version of Informix are you using? Stored procedures does support cursors. Check the manuals for the FOREACH , under SPL. FOREACH is used for row-by-row processing. Also, it provides row level locking. In your case, you could try the following. FOREACH cur1 FOR SELECT <colname> INTO <variable> FROM <table> IF <variable> = <condition> UPDATE <table> SET <colname> = <value> WHERE CURRENT OF cur1; END IF END FOREACH Hope this helps. > ----- Original Message ----- > From: Tim Del Bosco <timd@psst.com> > To: <informix-list@iiug.org> > Sent: Thursday, September 16, 1999 10:12 PM > Subject: Row Locking in Stored Procedures > > > > I'm creating a Stored Procedure which checks for a certain condition in a > > row, and if true it updates the row. This code was orginaly in a 4GL > > program which used an update cursor to lock the row. > > > > Since Stored Procedures to not allow cursors, how do I insure that the > > condition I'm checking for does not change before I update the row. > > > > I'm using SE with logging. >