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: A substr question

Re: A substr question

From: Alan D. Mills <alanmNOSPAM_at_uk.europe.mcd.mot.com>
Date: Tue, 26 May 1998 16:25:23 +0100
Message-ID: <6kemso$a7d$1@schbbs.mot.com>


You could pass the result of the SUBSTR through TRANSLATE to ensure that you only get digits back. Of course, you'll probably want to defined some sort of catch-all default for when the value isn;t a number.

--
Alan D. Mills

To email remove NOSPAM from address.
Alexander I. Doroshko wrote in message
<01bd8302$cf10cd40$190114c1_at_sister.grant.UUCP>...
>Probably, you have some records where first symbol
>of COL1 isn't a digit. Check it.
>
>Elton Chan <97980015r_at_polyu.edu.hk> wrote in article
><6jdoh6$bdg5_at_hkpa05.polyu.edu.hk>...
>
>> anybody can help, I come across a problem while using the following
>sql
>> that for data extraction.
>>
>> UPDATE TEST SET COL2 = (SUBSTR(COL1,1,1));
>> *
>> ERROR at line 1:
>> ORA-01722: invalid number
>>
>> while COL2 is number(1) and COL1 is Char(4) like 2X.9 or 6K.0 that I want
>to
>> extract the first number i.e. 2 and 6 from COL1 to COL2.
>---
>Alexander I. Doroshko, Bank "Grant", Ukraine
>aid_at_grant.kharkov.ua
Received on Tue May 26 1998 - 10:25:23 CDT

Original text of this message

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