Re: Problems with "IN"

From: Lisa S. <ljstewar_at_vac-acc.gc.ca>
Date: 16 Oct 2003 05:41:12 -0700
Message-ID: <ba0b4810.0310160441.71768833_at_posting.google.com>


"Jim Kennedy" <kennedy-down_with_spammers_at_no_spam.comcast.net> wrote in message news:<WKmjb.782313$Ho3.208508_at_sccrnsc03>...
> "Lisa S." <ljstewar_at_vac-acc.gc.ca> wrote in message
> news:ba0b4810.0310150916.67bf42e9_at_posting.google.com...
> > Can someeone help! This works:
> >
> > SELECT * FROM sometable
> > WHERE 1 IN (1, 2, 3) ;
> >
> > But if I want something like this:
> >
> > s_mylist VARCHAR2(20) := '1, 2, 3';
> >
> > SELECT * FROM sometable
> > WHERE 1 IN ( s_mylist ) ;
> >
> > It doesn't work. Can't I do this?
> >
> > Thanks
> > Lisa
>
> It does not work because s_mylist is one thing the string '1, 2, 3' instead
> of
> where 1 in (1,2,3)
> Also you are comparing numbers and strings - not good. compare numbers and
> numbers.
> Jim

Hi Jim

Sorry, I guess I wasn't clear - What we are trying to do is to format a string with the 'IN' items to check elsewhere and pass it into the stored procedure. I guess my question is - can't I use a variable with the 'IN' Operator ?
Thanks
Lisa Received on Thu Oct 16 2003 - 14:41:12 CEST

Original text of this message