Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Wild_Numbers!
Dana Stockler wrote:
>
> | I'm currently retraining for Oracle and have managed to bet my Christmas
> | turkey (well not quite ) that
> | a wildcard exists when conducting a search to specify numerical data ONLY
> | ie. to exclude all else. Now
> | I sincerely hope someone can back me up here and actually identify this
> | legendary wildcard and its operation.
>
> I'm not aware of any such wildcard.
>
> IMHO: Oracle is very weak as regards regular expression pattern matching.
> I have often needed (wanted?) functionality similar to what you describe.
>
> It just occurred to me that maybe I could write a stored function to
> implement
> some form of RegExpPatMat. If I ever get my head above water here I'll give
> it a try.
>
> Dana
function is_number(x varchar2) return vachar2 is
y number;
begin
y := to_number(x);
return 'Y';
exception when value_error then return 'N';
end;
select *
from table
where is_number(col) = 'Y';
Not blindingly fast...
--