Re: [SQL] Looking for information on PostgreSQL Stored Procedures

Поиск
Список
Период
Сортировка
От Douglas McNaught
Тема Re: [SQL] Looking for information on PostgreSQL Stored Procedures
Дата
Msg-id m2bqznh9m0.fsf@Douglas-McNaughts-Powerbook.local
обсуждение исходный текст
Ответ на Re: [SQL] Looking for information on PostgreSQL Stored Procedures  ("Foster, Stephen" <stephenlfoster@comcast.net>)
Ответы Re: [SQL] Looking for information on PostgreSQL Stored Procedures
Re: [SQL] Looking for information on PostgreSQL Stored Procedures
Список pgsql-general
"Foster, Stephen" <stephenlfoster@comcast.net> 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

В списке pgsql-general по дате отправления: