From: Oliver Jowett <oliver@opencloud.com>
To: Antony Paul <antonypaul24@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Pass column name in preparedstatement
Date: Wed, 16 Feb 2005 00:54:09 +1300
Message-ID: <4211E2E1.4090506@opencloud.com> (raw)
In-Reply-To: <2989532e050215032031e9aeb8@mail.gmail.com>
References: <2989532e050215032031e9aeb8@mail.gmail.com>
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: oliver@opencloud.com, antonypaul24@gmail.com
Subject: Re: Pass column name in preparedstatement
In-Reply-To: <4211E2E1.4090506@opencloud.com>
References: <2989532e050215032031e9aeb8@mail.gmail.com> <4211E2E1.4090506@opencloud.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