Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Is_number () like function
What about
where translate( my_char, '#0123456789.', '#' ) is null and length( translate( my_char, '123456789.', '.' ) ) <= 1
The first line makes sure your my_char only has digits or dots. The second line checks if there is at most one dot. The #-character, which in fact is replaced by itself, is used as Oracle does not allow the second string in translate(..) to be null.
Arjan.
Hilversum, the Netherlands
>RTRIM(translate(prix_B_G1,'1234567890.',' ')), but it cannot catch errors
>like :
> '.5' good number
> '0.4' good number
> '5.7.7' bad number
Received on Tue Jul 21 1998 - 12:36:27 CDT
![]() |
![]() |