Help with Procedures in pgsql

Поиск
Список
Период
Сортировка
От Nelio Alves Pereira Filho
Тема Help with Procedures in pgsql
Дата
Msg-id 3A22BD8C.A93790E1@ifx.com.br
обсуждение исходный текст
Ответы Re: Help with Procedures in pgsql  ("Robert B. Easter" <reaster@comptechnews.com>)
Список pgsql-sql
I have the folowing procedure in PL/pgsql:
CREATE FUNCTION set_counter () RETURNS INT AS '
DECLARE nivel_rec record;new_count integer;
BEGINUPDATE 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 saysIFX=# select set_counter();ERROR:  Attribute 'nivel_rec' not
foundIsn'tthat 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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Mark Hollomon
Дата:
Сообщение: Re: [HACKERS] Re: Rules with Conditions: Bug, or Misunderstanding
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Re: Rules with Conditions: Bug, or Misunderstanding