From: Tom Lane <tgl@sss.pgh.pa.us>
To: Foster, Stephen <stephenlfoster@comcast.net>
Cc: 'Michael Fuhr' <mike@fuhr.org>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Looking for information on PostgreSQL Stored Procedures
Date: Sun, 11 Dec 2005 12:04:18 -0500
Message-ID: <17301.1134320658@sss.pgh.pa.us> (raw)
In-Reply-To: <000001c5fe70$f5e51330$2101a8c0@cfgod>
References: <000001c5fe70$f5e51330$2101a8c0@cfgod>
"Foster, Stephen" <stephenlfoster@comcast.net> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, stephenlfoster@comcast.net, mike@fuhr.org, pgsql-general@postgresql.org
Subject: Re: [SQL] Looking for information on PostgreSQL Stored Procedures
In-Reply-To: <17301.1134320658@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox