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 -> How do I test if a value is numeric?

How do I test if a value is numeric?

From: Graeme Richardson <graeme_at_adept_zero_spam_x.co.nz>
Date: Wed, 18 Dec 2002 15:28:16 +1300
Message-ID: <atomdi$8dk$1@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 Tue Dec 17 2002 - 20:28:16 CST

Original text of this message

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