Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: change a characte in a string
Jeff Smith wrote:
> You could start by reading the manual and look up the replace() function.
>
> "Hubert Holler" <haiflosse_at_gmx.net> wrote in message
> news:3fd596d4$0$43170$91cee783_at_newsreader02.highway.telekom.at...
>
>>Ho can I change a character in a string wiht pl/sql. >>I have the following string : "_ _ _ " and want to change the second "_"
>>exampel to "E". >>Hope somebody can help me there. >>Thanks a lot >>Hubert
He could but it would do him no good. REPLACE would replace every "_" not just the second "_" and I am presuming this is a placehold for real data and your real data isn't a bunch of underscores.
To replace only the second you are going to need to use INSTR to identify its location (if it varies), cut the string into pieces with SUBSTR and then concatenate it back together again.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Tue Dec 09 2003 - 07:53:09 CST
![]() |
![]() |