Re: Can I use an array with an IN clause?



flarosa wrote:
...
I tried doing this:

SELECT * FROM MyTable WHERE ID IN ?

That's impossible in your case.

I tried passing an array of integers as the parameter, but it didn't
work.

I can solve the problem by generating a query of the form "WHERE ID IN
(?,?,?,?)", but I have to create a new query from scratch each time
because the number of integers varies.

No - you have to define more than one Statements.

Alfred
.



Relevant Pages

  • Re: Can I use an array with an IN clause?
    ... I tried passing an array of integers as the parameter, ... I can solve the problem by generating a query of the form "WHERE ID IN ... because the number of integers varies. ... Without knowing more about your app it is a bit hard to say what you ...
    (comp.lang.java.databases)
  • Re: Can I use an array with an IN clause?
    ... I tried passing an array of integers as the parameter, ... I can solve the problem by generating a query of the form "WHERE ID IN ... because the number of integers varies. ... FirstSQL/J Object/Relational DBMS ...
    (comp.lang.java.databases)
  • Re: Syntax Error
    ... Thanks for your help....looks like I will start from scratch. ... > That is an invalid statement. ... That wil bring up the query builder which you can use to ... > queries I would rebuild the form over agaon from scratch using the wizard. ...
    (microsoft.public.access.forms)
  • Re: Tables/Form
    ... <scratch, scratch!> ... for your new sequence number in your new record. ... Use that value from the query in ... Microsoft Office/Access MVP ...
    (microsoft.public.access.gettingstarted)
  • Can I use an array with an IN clause?
    ... I want to execute a prepared statement of the form: ... I tried passing an array of integers as the parameter, ... I can solve the problem by generating a query of the form "WHERE ID IN ... because the number of integers varies. ...
    (comp.lang.java.databases)