"Foster, Stephen" <[EMAIL PROTECTED]> writes:
> WHILE (--Lost on variable name for end of query; EmptyQueryResponse <>
> 0? --)
> BEGIN
> IF LastName = fname THEN
> DELETE FROM MailingList WHERE id = id;
> END IF;
> LastName := fname;
> FETCH NEXT FROM NewListCursor INTO fname, id;
> END;
> CLOSE NewListCursor;
> $BODY$
> LANGUAGE 'sql' VOLATILE;
You can't do any looping or other control structures in an SQL
function. Use PL/pgSQL instead.
-Doug
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org