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

Home -> Community -> Usenet -> c.d.o.server -> Re: How do I test if a value is numeric?

Re: How do I test if a value is numeric?

From: Jack <nn_at_mail.com>
Date: Thu, 19 Dec 2002 08:14:42 GMT
Message-ID: <SdfM9.53$o24.24@read3.inet.fi>


Hi!

Maybe this helps?

   where

          substr(P,1,1) in ('0','1','2','3','4','5','6','7','8','9') AND
          substr(P,2,1) in ('0','1','2','3','4','5','6','7','8','9') AND
          substr(P,3,1) in ('0','1','2','3','4','5','6','7','8','9') AND
          substr(P,4,1) in ('0','1','2','3','4','5','6','7','8','9') AND
          substr(P,5,1) in ('0','1','2','3','4','5','6','7','8','9') AND
          substr(P,6,1) in ('0','1','2','3','4','5','6','7','8','9') AND

"Graeme Richardson" <graeme_at_adept_zero_spam_x.co.nz> wrote in message news:atomdi$8dk$1_at_news.wave.co.nz...
> I have a Char(30) field in a database that has been used to store a
> variable length persons name and optionally a 2 decimal number (e.g.
12.34,
> and 2.34). The number is always preceded by at least one space.
>
> I need records where there is a number on the end. How do I write a clause
> to do this?
>
> I have clause that converts the last six characters to a numeric value
(used
> in Select clause):
>
> CAST(SUBSTRING(CB_TR_NARRATIVE FROM POSITION (' ' IN CB_TR_NARRATIVE FROM
> 24) AS NUMERIX(4,2)) AS Actual
>
> but for the case where a number is not included, this fails.
>
> Thanks for any help you can offer,
> --
> Graeme Richardson
> Analyst Programmer
> AdeptX Limited
>
>
Received on Thu Dec 19 2002 - 02:14:42 CST

Original text of this message

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