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 to update portion of the varchar type data

Re: how to update portion of the varchar type data

From: Paul Brewer <paul_at_paul.brewers.org.uk>
Date: Thu, 28 Nov 2002 21:42:13 -0000
Message-ID: <3de7ba3f$1_2@mk-nntp-1.news.uk.worldonline.com>


"Hkgirlygirl" <hkgirlygirl_at_aol.com> wrote in message news:20021127212454.05401.00000114_at_mb-fj.aol.com...
> I have a table called OBJTABLE with two columns,
> ID number(10)
> OBJECTCODE VARCHAR(200)
>
> and I would like to update a portion of the OBJECTCODE field
>
> e.g. one row in the OBJECTCODE column value is
> '00A BCD'
> and I like to update col 4-6 with a value
>
> But when I execute the following SQL I got ORA-00927 MIISSIING EQUAL SIGN
>
> Update OBJTABLE set substr(OBJECTCODE,4,3) = '123'
> where substr(OBJECTCODE,1,3) = '00A'
>
> I am using Oracle8i.
>
> Have anyone come across a way to update portion of the varchar data type?
> Thanks in advance for your help!
>

Martin and Norman have answered your specific question. But I suggest that you need to revisit the design here.
If you need to update positions 4 to 6, it sounds like it's a separate attribute.
Do you need to decompose?

Regards,
Paul Received on Thu Nov 28 2002 - 15:42:13 CST

Original text of this message

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