Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eB13EmF41977 for ; Thu, 30 Nov 2000 22:14:48 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from tutopia.tutopia.com.br (mail.ifx.com.br [200.213.155.66]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eARK0bt71757 for ; Mon, 27 Nov 2000 15:00:37 -0500 (EST) (envelope-from nelio@ifx.com.br) Received: from ifx.com.br (unverified [200.213.155.110]) by tutopia.tutopia.com.br (Rockliffe SMTPRA 4.2.1) with ESMTP id for ; Mon, 27 Nov 2000 18:02:24 -0300 Message-ID: <3A22BD8C.A93790E1@ifx.com.br> Date: Mon, 27 Nov 2000 18:01:16 -0200 From: Nelio Alves Pereira Filho X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.17-6 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Help with Procedures in pgsql Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200011/299 X-Sequence-Number: 331 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