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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL help

Re: SQL help

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 24 May 2005 20:52:57 -0800
Message-ID: <4293f699@news.victoria.tc.ca>


ndpace_at_gmail.com wrote:
: I am creating a package for Oracle 8i. I need to pass a variable in
: and use that in the SQL statement IN clause. This worked for a simple
: equal statement but not for the IN.

: 'select * from CUSTOMERS where CUSTOMERS_CODE in (:x1) ' USING IDS;

: where IDS is VARCHAR2 and = 999,1000

I'm sure google would turn up suggestions, since this is often discussed.

One technique is to pass the list (999,1000) as a string '999,1000', and then use a string function such as the PL/SQL Oracle equivalent of C's strstr() (I don't recall the name of the function, that is why I don't give the name).

If strstr where available, you could do something like

where strstr(:X,to_char(CUSTOMERS_CODE)) is not null

--

This space not for rent.
Received on Tue May 24 2005 - 23:52:57 CDT

Original text of this message

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