Skip site navigation (1) Skip section navigation (2)

Re: Pass column name in preparedstatement

From: Antony Paul <antonypaul24(at)gmail(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Pass column name in preparedstatement
Date: 2005-02-15 12:04:56
Message-ID: 2989532e05021504045fc879fe@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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(at)opencloud(dot)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
>

In response to

Responses

pgsql-jdbc by date

Next:From: Thomas HallgrenDate: 2005-02-15 12:27:15
Subject: Re: Pass column name in preparedstatement
Previous:From: Oliver JowettDate: 2005-02-15 11:54:09
Subject: Re: Pass column name in preparedstatement

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group