Re: PL/SQL variable number of ORs in SELECT

From: REIP Jean-Claude <jacari.consultant_at_skynet.be>
Date: 1997/08/05
Message-ID: <01bca1e0$4c332de0$LocalHost_at_default>#1/1


Frank,

Why don't you use standard syntax as

	... SELECT * FROM my_table
	WHERE my_num IN( &my_vay)

or

	... SELECT * FROM my_table
	WHERE my_num IN( :my_vay)

(depending of your program : SQLPLUS,
SQLFORMS, ....) ?

-- 
REIP Jean-Claude
jacari.consultant_at_skynet.be

Frank Curti <curti_at_rci.rutgers.edu> a
écrit dans l'article
<5s7nmm$bkf_at_amenti.rutgers.edu>...

> I have a stored procedure that must
build cursors based on an input
> string that contains a variable
number of search parameters that are
> ORed together in a select statement.
> For instance if I pass in the string
22;34;67 I would have the
> following statement
> OPEN cursor_name FOR SELECT * FROM
my_table WHERE my_num = '22'
> OR my_num = '34' OR my_num = '67';
>
> Can I build this dynamically, in some
instances we may have to pass in up
> to 100 search parameters. I looked
at the DBMS_SQL package but was unable
> to find a way to use it in this case.
>
> Thank you
> Frank Curti
>
Received on Tue Aug 05 1997 - 00:00:00 CEST

Original text of this message