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: Is_number () like function

Re: Is_number () like function

From: Arjan van Bentem <avbentem_at_DONT-YOU-DARE-cable.a2000.nl>
Date: Tue, 21 Jul 1998 19:36:27 +0200
Message-ID: <6p2jj1$dst$1@newton.a2000.nl>


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

Original text of this message

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