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

Thread: Pulling Out The Numbers

  1. #1
    Join Date
    Sep 2001
    Location
    Atlanta, GA
    Posts
    7

    Question

    I've been looking around for this all day. Is there anyway to determine if a non number variable can be converted cleanly to a number? In other words the equivalent to an IsNumber function in Oracle.

    I have some garbage data that I'm attempting to clean up and I'd like to pull the numeric data from a column and put the data that is alphanumeric into a comment column.

    Thanks.
    CMerc

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Code:
    CREATE OR REPLACE FUNCTION IsNumber (p_in VARCHAR2)
    RETURN VARCHAR2 IS
      dummy NUMBER;
    BEGIN
      dummy := p_in;
      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?

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