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: Numeric string ??

Re: Numeric string ??

From: Kenneth C Stahl <BlueSax_at_Unforgettable.com>
Date: Wed, 08 Dec 1999 08:35:17 -0500
Message-ID: <384E5E95.79FB2E6C@Unforgettable.com>


Olivier BRUZEAUX wrote:
>
> I am looking for an sql command to test in my string is only numeric ??
> VARCHAR string [15]
>
> Olivier

If you are talking about plsql, then do it like this:

Function Is_Number(Buff varchar2) return integer is

    Dummy Number := 0;
begin

    Dummy := Buff;
    return(0);
exception

    when invalid_number then

        return(1);
    when others then

        return(2)
end;

If you pass a numeric string to the function it will return 0 if the value was truely numeric, if it is an invalid number it will return 1. If there was some other error it will return 2. Received on Wed Dec 08 1999 - 07:35:17 CST

Original text of this message

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