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

Re: BUG #2494: SCROLL CURSOR does not worl

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Michal Szymanski <biuro(at)globeinphotos(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2494: SCROLL CURSOR does not worl
Date: 2006-06-28 15:34:13
Message-ID: 20060628153412.GX44573@pervasive.com (view raw or flat)
Thread:
Lists: pgsql-bugs
There's no such thing as a 'SCROLL CURSOR' in plpgsql:
http://www.postgresql.org/docs/8.1/interactive/plpgsql-cursors.html
I'm pretty sure that the default behavior would be scrollable.

We should probably add a TODO to bring the plpgsql cursor syntax inline
with what the backend supports.

On Fri, Jun 23, 2006 at 01:44:24PM +0000, Michal Szymanski wrote:
> 
> The following bug has been logged online:
> 
> Bug reference:      2494
> Logged by:          Michal Szymanski
> Email address:      biuro(at)globeinphotos(dot)com
> PostgreSQL version: 8.1
> Operating system:   Windows
> Description:        SCROLL CURSOR does not worl
> Details: 
> 
> Function with scroll cursor  cannot be compiled.
> ERROR:  syntax error at or near "CURSOR"
> CONTEXT:  invalid type name "SCROLL CURSOR FOR SELECT * FROM freeconet.alias
> WHERE mask >"
> compile of PL/pgSQL function "dummy" near line 3
> 
> Function that I want compile.
> CREATE OR REPLACE FUNCTION freeconet.dummy (
>                                  )    RETURNS INT8 AS $$
> DECLARE
> rowvar freeconet.ALIAS%ROWTYPE;
> DECLARE curs1  SCROLL CURSOR  FOR SELECT * FROM freeconet.alias WHERE
> mask>='+4850X' LIMIT 100 ;
> BEGIN
>     BEGIN
> 
> OPEN curs1;
> FETCH curs1 INTO rowvar;
> 
>     EXCEPTION
>     WHEN OTHERS THEN
>          RAISE WARNING '.... Kod bledu = %', SQLSTATE;
>              RETURN -1;   /* blad danych */
>     END;
>      RAISE WARNING ' mask=%',rowvar.mask;
>      RETURN 1;
> END;
> $$ LANGUAGE 'plpgsql' VOLATILE;
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 

-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby(at)pervasive(dot)com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

In response to

Responses

pgsql-bugs by date

Next:From: Jim C. NasbyDate: 2006-06-28 15:35:50
Subject: Re: [BUGS] BUG #2500: subscribing for digest
Previous:From: Alvaro HerreraDate: 2006-06-28 14:05:37
Subject: Re: RE : BUG #2497: bug initdb

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