Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL help
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
![]() |
![]() |