Re: Problems with "IN"

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Thu, 16 Oct 2003 14:17:35 GMT
Message-ID: <3Mxjb.292700$mp.232123_at_rwcrnsc51.ops.asp.att.net>


"Lisa S." <ljstewar_at_vac-acc.gc.ca> wrote in message news: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

Not that way. go to asktom.oracle.com and do a search. You will find something there that will help you.
Jim Received on Thu Oct 16 2003 - 16:17:35 CEST

Original text of this message