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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Foster, Stephen" <stephenlfoster(at)comcast(dot)net>
Cc: "'Michael Fuhr'" <mike(at)fuhr(dot)org>, pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Looking for information on PostgreSQL Stored Procedures
Date: 2005-12-11 17:04:18
Message-ID: 17301.1134320658@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

"Foster, Stephen" <stephenlfoster(at)comcast(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-12-11 17:04:38 Re: TSearch2: Auto identify document language?
Previous Message Foster, Stephen 2005-12-11 16:49:18 Re: [SQL] Looking for information on PostgreSQL Stored Procedures

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-12-11 17:22:18 Re: [SQL] Looking for information on PostgreSQL Stored Procedures
Previous Message Foster, Stephen 2005-12-11 16:49:18 Re: [SQL] Looking for information on PostgreSQL Stored Procedures