Text Manipulation [message #371509] |
Tue, 31 October 2000 09:00 |
amish modi
Messages: 1 Registered: October 2000
|
Junior Member |
|
|
In a text string how one can change a character at a particular position ? (The character is repeated various times in a string but only the character at particular position should be changed)
|
|
|
Re: Text Manipulation [message #371514 is a reply to message #371509] |
Wed, 01 November 2000 07:10 |
Just Me
Messages: 10 Registered: November 2000
|
Junior Member |
|
|
let's say that :
t - the table
v - the varchar field
3 - the position
'C'-the new char
update t set v=decode(length(v)<3,v,left(v,3-1)||'C'||substr(v,3+1))
|
|
|
Re: Text Manipulation [message #371543 is a reply to message #371509] |
Fri, 03 November 2000 13:26 |
Amit Chauhan
Messages: 74 Registered: July 1999
|
Member |
|
|
Hi,
Am not sure if theres a function called 'left' in Oracle as written by 'Just Me'. Anyway, you can use this SQL also :
Assume you want to change the character at 3rd position to x :
select substr('amit', 1, 3 - 1) || 'x' || substr('amit', 3 + 1)
from dual
Hope it helps
Thanks
Amit
|
|
|