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

Home -> Community -> Usenet -> comp.databases.theory -> Re: Using a parameter with an IN clause?

Re: Using a parameter with an IN clause?

From: Andrew Jens <andrewjens_at_hotmail.com>
Date: Thu, 24 Jan 2002 14:06:15 +1100
Message-ID: <3c4f6894@dnews.tpgi.com.au>


Just a quick followup,
The following site gives some information on this http://www.sqlteam.com/item.asp?ItemID=4619 I still have problems as I want to do this with a M$ Access query.

> Just a general question.
> With the following table called 'test' (ID is numeric, Name is text):
>
> Id Name
> = ====
> 1 Red
> 2 Green
> 3 Blue
>
> the following sql: 'SELECT Id, Name FROM test WHERE Id In ([p])'
> works very well if a single number is used when run (e.g p is made equal
to
> 2). Of course the query 'SELECT Id, Name FROM test WHERE Id In (1,2)'
works
> well, but when a comma-separated list is passed to the query (e.g. 1,2) it
> doesn't work.
> So the question is: why does a comma-separated list work when hard-coded,
> but not when used with a parameter?
> Thanks in advance for any assistance possible.
>
>
>
>
Received on Wed Jan 23 2002 - 21:06:15 CST

Original text of this message

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