Skip site navigation (1) Skip section navigation (2)

Re: Cursor Error

From: "Bob Pawley" <rjpawley(at)shaw(dot)ca>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cursor Error
Date: 2008-07-31 18:17:44
Message-ID: 007501c8f339$bc445760$6401a8c0@owner (view raw or flat)
Thread:
Lists: pgsql-general
Is it allowed to declare a cursor in this manner??

Declare
 procgraphic cursor for select p_id.p_id.process_id from p_id.p_id, 
processes_count
   where p_id.p_id.p_id_id = processes_count.p_id_id;

Bob



----- Original Message ----- 
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bob Pawley" <rjpawley(at)shaw(dot)ca>
Cc: "PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Sent: Thursday, July 31, 2008 9:50 AM
Subject: Re: [GENERAL] Cursor Error


> "Bob Pawley" <rjpawley(at)shaw(dot)ca> writes:
>> Right.
>> This is the cursor statement.
>
>>  Open procgraphic for select p_id.p_id.process_id from p_id.p_id,
>> processes_count
>>  where p_id.p_id.p_id_id = processes_count.p_id_id;
>
> Sorry, we're not bright enough to handle WHERE CURRENT OF on a join
> --- per the fine manual,
>
> The cursor must be a simple (non-join, non-aggregate) query on
> the UPDATE's target table.
>
> I don't recall offhand whether there's some deep technical reason
> for the restriction against joins, or we just didn't get around to
> it.  In any case, you'll need to change the cursor to return the
> table's primary key and use that to target the UPDATE.
>
> regards, tom lane
>
> -- 
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general 


In response to

Responses

pgsql-general by date

Next:From: Magnus HaganderDate: 2008-07-31 18:17:52
Subject: Re: Doing an LDAP lookup from a SQL SELECT
Previous:From: Richard HuxtonDate: 2008-07-31 18:12:32
Subject: Re: PL/pgSQL equivalent to PQtransactionStatus?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group