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 23:08:38 -0800
Message-ID: <42941666@news.victoria.tc.ca>


DA Morgan (damorgan_at_psoug.org) wrote:
: Malcolm Dew-Jones wrote:
: > 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

: Why SUBSTR when you can feed it in directly?

I didn't use SUBSTR, so I'm not sure what you mean.

--

This space not for rent.
Received on Wed May 25 2005 - 02:08:38 CDT

Original text of this message

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