Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Numeric Function
The suggestions so far are fine but...
what about a number like 7.3?
You may want to include a decimal point in the translate list.
Try this. If you dont care about decimals, remove it from the translate list.
FUNCTION Is_Numeric(in_value IN varchar2) RETURN boolean is
v_retval boolean;
BEGIN
IF REPLACE(TRANSLATE(in_value,'0123456789.',' '),' ','') IS NULL THEN v_retval := TRUE; ELSE v_retval := FALSE; END IF; RETURN v_retval;
END Is_Numeric;
Mark
Richard Kuhler <noone_at_nowhere.com> wrote in message news:<%yjG7.20674$D5.8286434_at_typhoon.san.rr.com>...
> Connor McDonald wrote:
> >
> > NeedaHoliday wrote:
> > >
> > > Is there a function or method to search a string character and find
> > > only numeric values?
> > >
> > > Thanks
> >
> > where
> > replace(
> > translate(col,'0123456789','9999999999')
> > '9',null) is null
> >
> > or thereabouts
> >
>
> or more efficiently....
>
> where translate(col, ' 0123456789', ' ') is null
>
>
> Richard
Received on Thu Nov 08 2001 - 04:09:34 CST
![]() |
![]() |