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: <hughesguy_at_my-dejanews.com>
Date: Fri, 15 May 1998 03:26:20 GMT
Message-ID: <6jgckr$cip$1@nnrp1.dejanews.com>


In article <6jdoh6$bdg5_at_hkpa05.polyu.edu.hk>,   "Elton Chan" <97980015r_at_polyu.edu.hk> wrote:
>
> Hi all,
>
> 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.
>
> Anybody help???
>
> Thanks,
> Elton
>
>

Try using the following:

UPDATE TEST SET COL2 = to_number(SUBSTR(COL1,1,1));

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Thu May 14 1998 - 22:26:20 CDT

Original text of this message

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