|
Home > Archive > Pgadmin > June 2005 > Scroll Cursor Bug?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Scroll Cursor Bug?
|
|
| Larry Morroni 2005-06-20, 8:24 pm |
| Hi, I am hitting an issue when using SCROLL CURSORS.
My Setup:
- WinXP running PGAdminIII v1.2.2
- PostgreSQL 8 Server
My Test Function:
CREATE OR REPLACE FUNCTION DemoFunction () RETURNS varchar(50) AS
$$
DECLARE CursorProductGroups SCROLL CURSOR FOR SELECT * FROM TEST_TABLE;
RETURN NULL;
END;
$$
LANGUAGE plpgsql
;
The Error that the Query Tool spits out:
ERROR: syntax error at or near "CURSOR"
CONTEXT: invalid type name "SCROLL CURSOR FOR SELECT * FROM TEST_TABLE"
compile of PL/pgSQL function "demofunction" near line 1
It seems like the Query Tool has a bug with this because my demo looks
just like the examples given in the PostgreSQL documentation.
Any ideas?
Larry Morroni
| |
| Sim Zacks 2005-06-21, 3:24 am |
| 1) You don't have a Begin. The format is Declare then Begin and then
lastly End
2) My understanding is that these error messages would come directly from the
server and not the query tool. Have you tried running the same query
using psql?
Sim Zacks
____________________
____________________
____________________
____________________
Hi, I am hitting an issue when using SCROLL CURSORS.
My Setup:
- WinXP running PGAdminIII v1.2.2
- PostgreSQL 8 Server
My Test Function:
CREATE OR REPLACE FUNCTION DemoFunction () RETURNS varchar(50) AS
$$
DECLARE CursorProductGroups SCROLL CURSOR FOR SELECT * FROM TEST_TABLE;
RETURN NULL;
END;
$$
LANGUAGE plpgsql
;
The Error that the Query Tool spits out:
ERROR: syntax error at or near "CURSOR"
CONTEXT: invalid type name "SCROLL CURSOR FOR SELECT * FROM TEST_TABLE"
compile of PL/pgSQL function "demofunction" near line 1
It seems like the Query Tool has a bug with this because my demo looks
just like the examples given in the PostgreSQL documentation.
Any ideas?
Larry Morroni
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql
.org
| |
| Larry Morroni 2005-06-21, 7:25 am |
| Thanks for the response, Sim.
- I forgot to include the BEGIN in the example I sent. Even with the
BEGIN, I get the same error.
- I tried this with psql and you are right, the server spits back the
message. Therefore, I will move this to the postgres forum.
Thanks!
Sim Zacks wrote:
> 1) You don't have a Begin. The format is Declare then Begin and then
> lastly End
>
> 2) My understanding is that these error messages would come directly from the
> server and not the query tool. Have you tried running the same query
> using psql?
>
> Sim Zacks
>
> ____________________
____________________
____________________
____________________
>
> Hi, I am hitting an issue when using SCROLL CURSORS.
>
> My Setup:
> - WinXP running PGAdminIII v1.2.2
> - PostgreSQL 8 Server
>
>
>
> My Test Function:
>
> CREATE OR REPLACE FUNCTION DemoFunction () RETURNS varchar(50) AS
> $$
> DECLARE CursorProductGroups SCROLL CURSOR FOR SELECT * FROM TEST_TABLE;
> RETURN NULL;
> END;
> $$
> LANGUAGE plpgsql
> ;
>
>
> The Error that the Query Tool spits out:
> ERROR: syntax error at or near "CURSOR"
> CONTEXT: invalid type name "SCROLL CURSOR FOR SELECT * FROM TEST_TABLE"
> compile of PL/pgSQL function "demofunction" near line 1
>
> It seems like the Query Tool has a bug with this because my demo looks
> just like the examples given in the PostgreSQL documentation.
>
> Any ideas?
>
> Larry Morroni
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql
.org
>
|
|
|
|
|