Update cursor - current of??

Поиск
Список
Период
Сортировка
От MaFa
Тема Update cursor - current of??
Дата
Msg-id 002901c3a090$959831a0$490e030a@attila
обсуждение исходный текст
Ответы Re: Update cursor - current of??  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-novice
Hi All!

I had run into the following problem.
I created a function using cursors, but when I call it, it returns an
error....
I created a very simple "test" function - and the result is the same...
:-(((

The error message with the test function is the following:
------------------
ERROR:  parser: parse error at or near "of" at character 49

WARNING:  Error occurred while executing PL/pgSQL function proba
WARNING:  line 10 at SQL statement
--------------------

Here is the source of my function:
--------------------
CREATE OR REPLACE FUNCTION "public"."proba" () RETURNS integer AS'
declare
       n_id integer;
       users_c cursor for select id from ugyfelek for update;

begin
     open users_c;
     loop
         fetch users_c into n_id;
         update users
                set megj=''Something''
                where current of users_c;
     end loop;
     close users_c;
     return 1;
end;
'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
----------------------

It seems to be a problem with the "current of" clause. The table "ugyfelek"
has primary key...

Could you help me to solve this problem?

Thanks: MaFa


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Exporting data from PostgreSQL
Следующее
От: "MaFa"
Дата:
Сообщение: Update cursor - current of