Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Parameterizing queries with SQL "IN" clauses

Parameterizing queries with SQL "IN" clauses

From: Eric Bell <eric.bell_at_attws.com>
Date: Thu, 19 Oct 2000 17:54:59 -0700
Message-ID: <8so4v8$rr0$1@redftp.redftp.attws.com>

I have query that I am calling using JDBC. The query has an "IN" clause in it:

    select *

        from table1
        where id in (123,234,234,234);

I would like to be able to pass the values in the "IN" clause via a parameter, such as:

    select *

        from table1
        where id in (?);

Then in my JDBC code I would have:

    preparedStatement.setString(1, "123,234,234,234" );

This doesn't work, which doesn't surprise me. But does anybody know a way to do this, or do I have to build my IN clause in code?

Thanks Received on Thu Oct 19 2000 - 19:54:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US