Re: Delete Cursor: What To Use In Select Clause?
Posted in 1996
Jonathan Leffler wrote: > I have seen a couple of answers, but neither of them addressed what I would > regard as the fundamental question, which is: > > * If you aren't interested in the values from the SELECT, why are you using > a SELECT FOR UPDATE and DELETE WHERE CURRENT OF statements? For a few reasons, actually: 1. Like you mention, I am using a subquery that would have to refer to the table being deleted. 2. I want to avoid long transaction errors and excessive locking. There are begin/commit work pairs during the processing of the cursor. 3. I want to provide users with feedback while processing. I consider this a very important part of the interface, and it also helps debugging weird behavior... <grin> Since I'm using the shared memory IPC method, I cannot use the sqlbreakcallback() function (although I'd like to!), according to p. 9-29 of ESQL/C v7.1. If you know of ways to solve the above issues, I'd certainly like to hear them. Your idea of selecting the primary key into a temp table is excellent, but does not eliminate the long transaction and locking problem. -- Alexander J. Oss Computer Systems Manager Films for the Humanities & Sciences