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: Oracle equivalent of IsNumeric in SQLServer

Re: Oracle equivalent of IsNumeric in SQLServer

From: tojo <TomJordanTojo_at_hotmail.com>
Date: Thu, 29 Aug 2002 18:11:43 +0200
Message-ID: <MPG.17d8662d1e97de59896b2@news.t-online.de>


In article <f724a6c4.0208290711.641f9a45_at_posting.google.com>, c266366430 @hotmail.com says...
> Dear folks,
>
> In Transact-SQL (SQLServer 7/2000), there's a function called
> IsNumeric to determine whether an expression is a valid numeric type
> or not.
>
> For instance, "SELECT ISNUMERIC("No Number")" will return 0 (false),
> and "SELECT ISNUMERIC(123)" or "SELECT ISNUMERIC("123")" will return 1
> (true).
>
> Is there a similar function in Oracle SQL?
>

You can write your own PL/SQL function, something like:

FUNCTION IS_NUMBER
(

    p_str IN VARCHAR2
)
RETURN NUMBER IS
    v_dummy NUMBER;
BEGIN
    v_dummy := TO_NUMBER(p_str);
    RETURN -1;
EXCEPTION
   WHEN OTHERS THEN

Received on Thu Aug 29 2002 - 11:11:43 CDT

Original text of this message

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