create or replace function is_number( chk_data_in varchar2 )
return boolean
is
        dummy number(38,4);
begin
        dummy := to_number(chk_data_in);
        return true;
exception
when value_error then
        return false;
when others then
        raise;
end;
/

show errors function is_number


declare
        v_test varchar2(10) := '1E';
begin
        if is_number(v_test) then
                dbms_output.put_line(v_test || ' is a number');
        else
                dbms_output.put_line(v_test || ' is NOT a number');
        end if;
end;
/





"Smith, Ron L." <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
 01/31/2003 08:24 AM
 Please respond to ORACLE-L

 
        To:     Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
        cc: 
        Subject:        Check for all numeric in a column


What is the easiest / best way to check for a valid numeric value in a 
column?
 
R. Smith
 
If you are not the intended recipient of this e-mail message, any use, 
distribution or copying of the message is prohibited. Please let me know 
immediately by return e-mail if you have received this message by mistake, 
then delete the e-mail message. Thank you.


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).

Reply via email to