pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sim Zacks <sim@compulab.co.il>
To: pgsql-sql@postgresql.org
Subject: Re: scroll cursor bug or me?
Date: Wed, 22 Jun 2005 10:22:04 +0200
Message-ID: <d9b3nd$1b9s$1@news.hub.org> (raw)
References: <QrSdnW6Ltdl8jyXfRVn-vQ@comcast.com>

It seems to me that scroll cursors are not valid in plpgsql.
The following query in PGAdmin works. run one line at a time.

begin work;

declare bob scroll cursor for select * from testtbl;

fetch forward 5 from bob;
fetch prior  from bob;

rollback work;



"Larry Morroni" <lam170@yahoo.com> wrote in message
news:QrSdnW6Ltdl8jyXfRVn-vQ@comcast.com...
> Hi, I am hitting an issue when using SCROLL CURSORS.
>
> -->My Setup:
> PostgreSQL 8.0.3 on Windows XP Pro SP2
>
>
> -->My Test Function:
> CREATE OR REPLACE FUNCTION TestFunction () RETURNS varchar(50) AS
> $$
> DECLARE CursorProductGroups SCROLL CURSOR FOR SELECT * FROM TEST_TABLE;
> BEGIN
>          RETURN NULL;
> END;
> $$
> LANGUAGE plpgsql
> ;
>
> -->psql spits back the following:
>
> STORE_PHYSICAL_A=# \i test.sql
> psql:test.sql:9: ERROR:  syntax error at or near "CURSOR"
> CONTEXT:  invalid type name "SCROLL CURSOR FOR SELECT * FROM TEST_TABLE"
> compile of PL/pgSQL function "testfunction" near line 1
> STORE_PHYSICAL_A=#
>
> This seems like a bug to me because my demo looks
> just like the examples given in the PostgreSQL documentation.  ie...
>
> -- BEGIN POSTGRES DOC EXAMPLE
> BEGIN WORK;
> DECLARE liahona SCROLL CURSOR FOR SELECT * FROM films;
> FETCH FORWARD 5 FROM liahona;
> CLOSE liahona;
> COMMIT WORK;
> -- END POSTGRES DOC EXAMPLE
>
> Any ideas?
>
> Larry Morroni






Message-ID: <d9b3nd$1b9s$1@news.hub.org>
Permalink:  ../d9b3nd$1b9s$1@news.hub.org/
Also on:    postgresql.org/message-id/d9b3nd$1b9s$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sim@compulab.co.il
  Subject: Re: scroll cursor bug or me?
  In-Reply-To: <d9b3nd$1b9s$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox