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:
> This is one of the simple ones that has me hung up.  It currently errors
> out on the first line.  Why I have no idea.  It looks right to me.

You should show us the error message; most of us are not psychics.

> CREATE FUNCTION sp_removedups() RETURNS void AS
> $BODY$
> DECLARE lastname varchar(255);
> 	fname varchar(255);
> 	id bigint;
> DECLARE NewListCursor CURSOR FOR
> 	SELECT	Name, id
> 	FROM	MailingList
> 	ORDER BY Name;
> OPEN NewListCursor;

You're missing a BEGIN, and I'm not sure whether it's allowed to use the
DECLARE keyword twice in the same block (the second instance is certainly
unnecessary even if legal).

			regards, tom lane


[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