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

Home -> Community -> Usenet -> c.d.o.server -> Re: Looking for fields that contain % or _

Re: Looking for fields that contain % or _

From: Mserban <mserban_at_aol.com>
Date: 1997/03/23
Message-ID: <19970323064901.BAA09195@ladder01.news.aol.com>#1/1

Have you tried:

SELECT col1 FROM my_table
WHERE ((INSTR(col1,'%',1,1)+1>0) OR (INSTR(col1,'_',1,1)+1>0)) ?

Function INSTR returns the relative position of a character in a string; since the position of the character is relative to the beginning of the string, if % or _ is the first character in col1, INSTR may return a zero (I am not sure about that), that why you need the +1.

I hope this helps.

Michael Serbanescu
Senior Consultant, MIACO Corporation   Received on Sun Mar 23 1997 - 00:00:00 CST

Original text of this message

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