From: Nelio Alves Pereira Filho <nelio@ifx.com.br>
To: pgsql-sql@postgresql.org
Subject: Help with Procedures in pgsql
Date: Mon, 27 Nov 2000 18:01:16 -0200
Message-ID: <3A22BD8C.A93790E1@ifx.com.br> (raw)
I have the folowing procedure in PL/pgsql:
CREATE FUNCTION set_counter () RETURNS INT AS '
DECLARE
nivel_rec record;
new_count integer;
BEGIN
UPDATE nivel SET count=-2;
FOR nivel_rec IN SELECT * FROM nivel LOOP
new_count := set_counter_row (nivel_rec);
END LOOP;
RETURN new_count;
END;'
LANGUAGE 'plpgsql';
I create it, but when I do 'select set_counter()', it says
IFX=# select set_counter();
ERROR: Attribute 'nivel_rec' not found
Isn't that the right sintax to declare variables in pgsql? What's wrong
with it?
Does my procedure contain any other errors that will appear later?
Thanks
--
Nelio Alves Pereira Filho
IFX Networks
Sao Paulo / Brazil
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: nelio@ifx.com.br
Subject: Re: Help with Procedures in pgsql
In-Reply-To: <3A22BD8C.A93790E1@ifx.com.br>
References: <3A22BD8C.A93790E1@ifx.com.br>
* 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