Re: Numeric value in VARCHAR?

From: Allgas Energy Ltd <trskinner_at_allgas.com.au>
Date: 1997/11/19
Message-ID: <34723ae9.4452495_at_news.powerup.com.au>#1/1


On 17 Nov 1997 23:23:16 GMT, rswhitaker_at_ucdavis.edu (Robert Whitaker) wrote:

>Can anyone tell me of a way to interrogate a column that is a VARCHAR2 datatype
>to determine if the value can be converted to a number? Visual Basic has a nice
>function IsNumber(arg). Can't something similar be done with SQL?

Not directly, but you can always use plsql to trap the error from a sub block
eg
  is_it_numeric := TRUE;
  begin

      l_num := to_number(l_text);
  exception

      when others then 
           is_it_numeric := FALSE;

  end;

Regards
Tom Skinner Received on Wed Nov 19 1997 - 00:00:00 CET

Original text of this message