Re: Delete Cursor: What To Use In Select Clause?
Posted in 1996
Hi, DELETE does indeed lock the row(s), so I can see no benefit simply in obtaining the lock before doing the delete. Indeed, since obtaining the lock in this way will slow the process down (because there are many more engine/application data exchanges using SELECT FOR UPDATE and DELETE WHERE CURRENT OF), it means that the locks will be held longer using the SELECT/DELETE method rather than with a single DELETE statement. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: jonm@ingres.com (Jon Machtynger) }Date: Tue, 09 Jul 1996 09:09:24 GMT }X-Informix-List-Id: <news.25894> } }tvarnas@compulink.gr (Apostolos Varnas) wrote: } }>> One possible reason for using the cursor might be that you've run into }>> problems with references to the table from which you are deleting data in }>> sub-queries in the WHERE clause, or something along those lines. } }>another reason could be that he wants firstly to obtain a lock on the record }>he wants to delete before actually deleting it. } }I would have thought that the DELETE would have taken a lock before }deleting it... How could you delete it otherwise?