Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Update a specific character in a string.

$
0
0
Hi All...

I want to update a character in a specific position in a string. So I might have 'AAAAA' and I want to update the 3rd character to 'B' giving 'AABAA'

On informix is trivial..

* update table1 set col1[3]= 'B'

But on Oralce.. it seems the only way is...

* update table1 set col1 = substr(col1,1,2) || 'B' || substr(col1,4);

So the question is... is this truely the only way I can do this Oracle? Or is ther some function I am not aware of that will help.

Thanks....
Roger

Viewing all articles
Browse latest Browse all 13329

Trending Articles