Re: Update cursor - current of??

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: MaFa <mafalista(at)freemail(dot)hu>
Cc: "pgsql-novice(at)postgresql(dot)" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Update cursor - current of??
Date: 2003-11-06 23:29:26
Message-ID: 200311062329.hA6NTQ212460@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


We don't support WHERE CURRENT OF yet.

---------------------------------------------------------------------------

MaFa wrote:
> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Lim Seng 2003-11-07 13:37:28 Updating views
Previous Message Boris Popov 2003-11-06 23:25:37 Help with "locking" please