Re: Prepared select

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: rturnbull(at)strategicmind(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Prepared select
Date: 2004-04-14 11:16:47
Message-ID: 200404140916.LAA20164@rodos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
> How can I use a prepared select statement as mentioned in the documentation=
> on SQL PREPARE. Preparing the statement is easy, the problem is using the =
> plan to get a cursor. My assumption is the SQL OPEN command is not document=
> ed or there is some other libpq API to make this happen.
>
> Thanks
>
>
>
I'm using libpq and lines like below are working:

res = PQexec(conn,
"PREPARE plan001 ( integer , double precision , character ) AS SELECT a,b,d FROM foo WHERE a = $1 OR d > $2 OR b = $3");
...
res = PQexec(conn, "EXECUTE plan001 ( 3 , 6.66 , 'whatever' ) ");

HTH, pretty late reply - I know (but no one else did as far as I can tell)

Regards, Christoph

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2004-04-14 15:36:48 Re: PostgreSQL configuration
Previous Message Merlin Moncure 2004-04-14 11:08:55 Re: 7.5 beta version