Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Foster, Stephen" <stephenlfoster@xxxxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux