Re: ANY subquery and PreparedStatements - Mailing list pgsql-jdbc

From awc
Subject Re: ANY subquery and PreparedStatements
Date
Msg-id 3E539B18.6540683A@drytel.net
Whole thread Raw
In response to ANY subquery and PreparedStatements  (Felipe Schnack <felipes@ritterdosreis.br>)
Responses Re: ANY subquery and PreparedStatements  (Felipe Schnack <felipes@ritterdosreis.br>)
List pgsql-jdbc
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@ritterdosreis.br
> Cel.: (51)91287530
> Linux Counter #281893
>
> Centro Universitário Ritter dos Reis
> http://www.ritterdosreis.br
> ritter@ritterdosreis.br
> Fone/Fax.: (51)32303341
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org


pgsql-jdbc by date:

Previous
From: Felipe Schnack
Date:
Subject: Re: ANY subquery and PreparedStatements
Next
From: "Nick Fankhauser"
Date:
Subject: Re: pg73jdbc3.jar ClassNotFoundException