Re: Prepared statements aren't working with parameters with PQexecParams - Mailing list pgsql-general

From David Wilson
Subject Re: Prepared statements aren't working with parameters with PQexecParams
Date
Msg-id e7f9235d0809050019r1925d83ah5184809ffcd59107@mail.gmail.com
Whole thread Raw
In response to Prepared statements aren't working with parameters with PQexecParams  ("Subspace god" <subspacegod@gmail.com>)
List pgsql-general
On Fri, Sep 5, 2008 at 2:52 AM, Subspace god <subspacegod@gmail.com> wrote:

> The following does not work in C++, executed as above, in another session
> using two subsequent calls to PQexecParams
>
> PREPARE myquery (text) AS INSERT INTO myTable (word) VALUES ($1);
> EXECUTE myquery($1::text);

You're doing prepared statements incorrectly. Use PQprepare() and
PQexecPrepared() when using them from libpq; don't do them by hand on
your own.

--
- David T. Wilson
david.t.wilson@gmail.com

pgsql-general by date:

Previous
From: Maxim Boguk
Date:
Subject: Re: Postgresql optimisator deoptimise queries sometime...
Next
From: Ow Mun Heng
Date:
Subject: max_stack_depth Exceeded