Re: IN Lists

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 17 Feb 2009 18:58:32 -0700
Message-ID: <499b7958$1_at_news.victoria.tc.ca>



Mtek (mtek_at_mtekusa.com) wrote:
: On Feb 17, 2:05=A0pm, ddf <orat..._at_msn.com> wrote:
: > On Feb 17, 1:47=A0pm, Mtek <m..._at_mtekusa.com> wrote:
: >
: > > Sheesh, how hard can this be:
: >
: > > =A0 =A0 =A0IF p_code IN v_code_list THEN
: > > =A0 =A0 =A0 =A0 v_query :=3D v_query || ' AND p_code IN v_code_list';
: > > =A0 =A0 =A0END IF;
: >
: > > Does not like that. =A0The IN list will be dynamic.......
: >
: > > Oracle is being picky here......
: >
: > You might want to read here:
: >
: > http://oratips-ddf.blogspot.com/2008/09/how-dynamic.html
: >
: > David Fitzjarrell

: Crap that is a lot of work to do this simple task....

The only work is in reading through the numerous possibilities.

Personally I often find that INSTR is the easiest technique.

        (untested snippet)

        v_code_list := '~1~2~3~4~5~'; -- example of list as string         

        if instr( v_code_list , '~'||p_code||'~') > 0 then                  Received on Tue Feb 17 2009 - 19:58:32 CST

Original text of this message