Re: ANY subquery and PreparedStatements

From: Felipe Schnack <felipes(at)ritterdosreis(dot)br>
To: awc <awc(at)drytel(dot)net>
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: ANY subquery and PreparedStatements
Date: 2003-02-19 16:00:19
Message-ID: 1045670419.24757.63.camel@desenv1.ritterdosreis.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I Guess you don't understand my problem.. my problem is that I would
like to use preparedstatements with this query, but I would like to set
a list of values for the any parameter... In other words I would like to
execute, in the end a query like that:
select * from <table> where <field> any (1,2,3)
But I don't think I can do that using prep. statements... am i wrong?

On Wed, 2003-02-19 at 11:56, awc wrote:
> how about
>
> public String setCommand(String table,String filedName1)
> {
> StringBuffer sb = new StringBuffer("Select * from table ");
> sb.append(table);
> sb.append(" where ");
> sb.append(filedName1);
> sb.append(" any (?)");
> return sb.toSting();
> }
>
> Felipe Schnack wrote:
>
> > I'm afraid it kind of impossible to use PreparedStatements with the
> > "ANY" subquery keyword... For example, if I take this query and prepare
> > it:
> > "select * from <table> where <field> any (?)"
> > How can I set my parameter as a list of values, so my query searches
> > for for different values of the specified field?
> >
> > --
> >
> > Felipe Schnack
> > Analista de Sistemas
> > felipes(at)ritterdosreis(dot)br
> > Cel.: (51)91287530
> > Linux Counter #281893
> >
> > Centro Universitário Ritter dos Reis
> > http://www.ritterdosreis.br
> > ritter(at)ritterdosreis(dot)br
> > Fone/Fax.: (51)32303341
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
>
--

Felipe Schnack
Analista de Sistemas
felipes(at)ritterdosreis(dot)br
Cel.: (51)91287530
Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
ritter(at)ritterdosreis(dot)br
Fone/Fax.: (51)32303341

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mykola Dudar 2003-02-19 16:44:26 exception in decodeUTF8
Previous Message Felipe Schnack 2003-02-19 15:57:11 Re: ANY subquery and PreparedStatements