DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Funcion ISNUMERIC in Oracle

  1. #1
    Join Date
    Jan 2002
    Posts
    22
    Hi all,

    what is the translation for the sqlserver function ISNUMERIC
    in Oracle.

    Thanks

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Hi,
    I think there isn't anything similar.
    But if you need it you can write it yourself, a simple example could be:
    Code:
    create or replace function isnumeric (param in char) return boolean as
       dummy varchar2(100);
    begin
       dummy:=to_char(to_number(param));
       return(true);
    exception
       when others then
           return (false);
    end;
    /

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    I don't see any reason for using TO_CHAR(TO_NUMBER()) when a single TO_NUMBER would do:
    Code:
    create or replace function isnumeric (param in varchar2) return boolean as
       dummy number;
    begin
       dummy:=to_number(param);
       return(true);
    exception
       when others then
           return (false);
    end;
    /
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  4. #4
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Yes, that's pure truth.
    I cut it from another piece of code and made some adjustments and I overlooked that.
    Sorry for that and hope I didn't confuse anybody.
    Thanks Jurij for correction.
    Ales

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width