Thread: Re: update part of a column

Re: update part of a column

From
"K Parker"
Date:
> I would like to know if I can update part of a column. ie
>
> update myfile set > substr(direct_key,1,10)='1234567890' ....
>
>This does not work. Is this possible?

Not in the way you are attempting to do it.

>Or am I looking at this the wrong way?

Sure: just reassemble the _entire_ column keeping the parts from the original column value that you want to keep, and
insertingthe new parts you want to insert, e.g. 

 update myfile set direct_key =
   '1234567890' || substr(direct_key,11,10)
   where substr(direct_key,1,10) = '0123456789';


Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com