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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Function

Re: SQL Function

From: Richard Kuhler <noone_at_nowhere.com>
Date: Tue, 30 Apr 2002 22:12:13 GMT
Message-ID: <1FEz8.68527$VQ2.40171093@twister.socal.rr.com>


Strange, that looks almost identical to Daniel's First reply. Maybe you're not getting you're not getting a complete news feed?

Richard

Ken Denny wrote:
>
> "Prasad Yarlagadda" <prasad.yarlagadda_at_motorola.com> wrote in
> news:aajlft$b8u$1_at_localhost.localdomain:
>
> > Is there any standard SQL function available to check whether an array
> > of characters is a String or a Number? I am looking for something like
> > IS_NUMBER or IS_CHARACTER. I don't want to write a function for it if
> > oracle has already provided.
> >
> > TIA,
> > Prasad
> >
> >
>
> Lots of replies but none with the solution to your problem, so try this:
>
> FUNCTION is_number (numstring VARCHAR2) RETURN BOOLEAN
> IS
> /*
> || Returns true if the string contains a valid number
> */
> w_num NUMBER;
> BEGIN
> w_num := TO_NUMBER(numstring);
> RETURN TRUE;
> EXCEPTION
> WHEN INVALID_NUMBER OR VALUE_ERROR THEN
> RETURN FALSE;
> END is_number;
>
> --
> Ken Denny (PL/SQL guru in search of employment)
> http://www.kendenny.com/
>
> Planting vegetables is a great money-saver. Over the course of a summer,
> you could shave $75 off your grocery bill with just a few hundred hours of
> work.
Received on Tue Apr 30 2002 - 17:12:13 CDT

Original text of this message

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