Re: Delete Cursor: What To Use In Select Clause?
Posted in 1996
Topics: SQL Development & Query Writing
You have to select something; but
SELECT 1 FROM TABLENAME works quite nicely.
"Alexander J. Oss" <alex.oss@films.com> wrote:
>I am using a SELECT ... FOR UPDATE cursor to perform DELETE ... WHERE
>CURRENT statements.
>Since I am not interested in the contents of the records I am deleting, I
>don't really need anything in the select clause of the SELECT statement,
>but it seems that syntax requires me to put something there. I'm
>currently just using the serial not null primary key field.
>Does it matter what goes there? I know that with the NOT EXISTS
>subquery, the manual says that you might as well use SELECT * "because
>the existence of the whole row is tested; specific column values are not
>tested" [Syntax v7.1 1-529]. (Is this true?)
>I apologize if this is a newbie question; I didn't see it in the FAQ.
>--
>Alexander J. Oss
>Computer Systems Manager
>Films for the Humanities & Sciences