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: PL/SQL Using Variable IN Clause

Re: PL/SQL Using Variable IN Clause

From: Jomarlen <jomarlen_at_aol.com>
Date: 1997/11/24
Message-ID: <19971124215601.QAA17739@ladder02.news.aol.com>#1/1

Hi

Why is everyone obessed with solving this problem using IN, resulting in some weird and wonderful solutions.

There's a simple answer - use INSTR

Check_String = '*MOTHER*FATHER*GRANDMOTHER*GRANDFATHER*';

SELECT name
  FROM relatives
 WHERE instr(Check_String,'*'||relative_type||'*') <> 0

Note the use of asterisks to delimit the column and the individual values in the variable. This is so that only complete values are compared. i.e. FATHER is not found in GRANDFATHER
If an asterisk could be part of a valid value then use some other character which could not be as a delimiter.

John



John C. Lennon
Utility Partners Inc.
4300 West Tropicana Blvd LVO-UPL
Las Vegas NV 89103

Tel: (702) 498 4990
Fax: (702) 871 4318
e-mail: jomarlen_at_aol.com
Web Site: http://members.aol.com/jomarlen/

The views expressed in this message
are those of the author and not
necessarily those of U.P. Inc.
and/or its employees.


Received on Mon Nov 24 1997 - 00:00:00 CST

Original text of this message

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