| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to update portion of the varchar type data
Sure, but not with the approach you tried (you can't set the value of a
function call, only of a column).
update objtable
set objectcode = substr(objectcode, 1,3) || '123' || substr (objectcode, 7)
where objectcode like '00A%'
Martin Doherty
Hkgirlygirl wrote:
>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!
>
>
>
>
>
>
>
>
>
Received on Wed Nov 27 2002 - 20:42:19 CST
![]() |
![]() |