Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Function

RE: Function

From: kkennedy <kkennedy_at_firstpoint.com>
Date: Thu, 18 Jul 2002 09:55:56 -0800
Message-ID: <F001.0049B937.20020718095556@fatcity.com>


Try:
create or replace function is_number( parm in varchar2 ) return boolean
is
 x number;
begin
  x := to_number( parm );
  return true;
exception
  when value_error
  then
    return false;
end;

Kevin Kennedy
First Point Energy Corporation

-----Original Message-----
Sent: Thursday, July 18, 2002 9:59 AM
To: Multiple recipients of list ORACLE-L

Hi List,

Is there any way that I can check to see if the value in a variable is a number?

Example:

is_number('100') = TRUE
is_number('ABC') = FALSE

Hamid Alavi
Office 818 737-0526
Cell 818 402-1987

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Hamid Alavi
  INET: hamid.alavi_at_quovadx.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: kkennedy
  INET: kkennedy_at_firstpoint.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Jul 18 2002 - 12:55:56 CDT

Original text of this message

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