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: Help: to_number SQL*Plus error

Re: Help: to_number SQL*Plus error

From: BK <bkamiche2_at_sanmiguelind.com.pe>
Date: Mon, 21 Dec 1998 15:40:18 -0500
Message-ID: <75mb4g$n1d$1@ucayali.unired.net.pe>


try to_number(ltrim(rtrim(field))

Joost Ouwerkerk <joost.ouwerkerk_at_sickkids.on.ca> wrote in message news:367e8cf4.13972395_at_resunix.sickkids.on.ca...
>I am trying to cast a VARCHAR2 field into a number using TO_NUMBER for
>a calculation (credit card check digit verification algorithm) using
>only SQL*plus. The script errors out with an 'Invalid number'
>message, presumably because one of the VARCHAR2 field contains a
>non-numeric character. I've already TRANSLATEd dashes and spaces out,
>and I suppose I could add the whole alphabet in there, but is there no
>other way to find out if a field contains non-numeric chars?
>
>Joost Ouwerkerk
>Toronto, Canada
Received on Mon Dec 21 1998 - 14:40:18 CST

Original text of this message

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