From: Antony Paul <antonypaul24@gmail.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Pass column name in preparedstatement
Date: Tue, 15 Feb 2005 17:34:56 +0530
Message-ID: <2989532e05021504045fc879fe@mail.gmail.com> (raw)
In-Reply-To: <4211E2E1.4090506@opencloud.com>
References: <2989532e050215032031e9aeb8@mail.gmail.com>
<4211E2E1.4090506@opencloud.com>
In 7.3.3 is there any use in using PreparedStatement since the columns
may change for each query.
rgds
Antony Paul
On Wed, 16 Feb 2005 00:54:09 +1300, Oliver Jowett <oliver@opencloud.com> wrote:
> Antony Paul wrote:
> > Hi all,
> > Is it possible to pass column name to a PreparedStatement as a
> > parameter.
>
> No, you can only use parameter placeholders in places which the backend
> grammar allows parameters (namely, in expressions). Column names aren't
> one of those places.
>
> > Or should I use Statement.
>
> You can use either Statement or PreparedStatement so long as you insert
> the column name into the SQL query string yourself before giving it to
> the driver.
>
> -O
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: antonypaul24@gmail.com, oliver@opencloud.com
Subject: Re: Pass column name in preparedstatement
In-Reply-To: <2989532e05021504045fc879fe@mail.gmail.com>
References: <2989532e050215032031e9aeb8@mail.gmail.com> <4211E2E1.4090506@opencloud.com> <2989532e05021504045fc879fe@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox