cursors on prepared queries

From: Andro <andromede(at)gmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: cursors on prepared queries
Date: 2006-09-12 10:18:39
Message-ID: da7021e0609120318u2b6a6ca2wb744d692487c0ac2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi,

there isn't any interface for using cursors within libpq, I'll do with a
PQexec(conn,"DECLARE..."); and fetch.
Now I'd like to know if it's possible to prepare a query (that takes forever
to plan) and execute it into a cursor, like (SQL) :

PREPARE plan_name(int) AS SELECT * FROM abc WHERE a = $1;
DECLARE cur CURSOR FOR EXECUTE(3);

doing so, I get a 'syntax error at or near "EXECUTE" at character 24'

Is something wrong or is it just not supported by postgres?
Manual talks about read only cursors but I didn't find out discussions about
"anti-prepared-statement-cursors".

I'm using postgres-8.1.4.

Any help appreciated!

Thanks

Charles

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jeroen T. Vermeulen 2006-09-12 10:47:45 Re: cursors on prepared queries
Previous Message Bijay Singh Bisht 2006-09-04 11:18:34 ODBC Issue