REPLACE Function [message #666211] |
Fri, 20 October 2017 02:11 |
pstanand
Messages: 133 Registered: February 2005 Location: Chennai,India
|
Senior Member |
|
|
Hi I request your help in resolving a replace string issue.
I have column called ckex_text which is varchar2(6000).
In which the 735th position I'm updating with a value PEN.
I used replace function but it is updating other empty places with PEN along with the 735th position.
I would like to update only the 735th position alone.
Could you please help me.
thanks.
|
|
|
|
|
|
Re: REPLACE Function [message #666215 is a reply to message #666214] |
Fri, 20 October 2017 06:27 |
pstanand
Messages: 133 Registered: February 2005 Location: Chennai,India
|
Senior Member |
|
|
Hi,
I used the below query.
select replace(ckex_text1,substr(ckex_text1,735),'ABC'||substr(ckex_text1,738)) from text_tbl;
|
|
|
Re: REPLACE Function [message #666217 is a reply to message #666215] |
Fri, 20 October 2017 07:36 |
cookiemonster
Messages: 13920 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Replace is completely unnecessary there, this does the same* and is a lot easier to understand:
select substr(ckex_text1,1, 735)||'ABC'||substr(ckex_text1,738) from text_tbl
* Unless the chars from position 735 onwards also appear earlier in the string in their entirety. I doubt that's true.
|
|
|
|