| Author |
Topic |
|
madhu.paddu
Starting Member
6 Posts |
Posted - 2007-12-12 : 08:56:59
|
| hi friendscan any one help me how to replace a string with another string in a column of table with out effecting the other charcatersex:In srinivas reddy only 'srinivas' has to replace with 'sreenivas'regardsnukala |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-12-12 : 08:59:59
|
select replace('srinivas reddy', 'srinivas' ,'sreenivas') KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhu.paddu
Starting Member
6 Posts |
Posted - 2007-12-12 : 09:09:15
|
| hi friend can u plzexplain in detailex;srinivassrinivas reddysrinivasulusrinivasgoudin all this strings i want to replace the srinivas by sreenivas.can give me full syntax for this one.thanks in advanceregards madhunukala |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2007-12-12 : 09:11:33
|
| You have already been given the syntax. Look up REPLACE in Books Online. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-12 : 09:17:45
|
| You need to apply that in the columnselect replace(your_column, 'srinivas' ,'sreenivas') from tableMadhivananFailing to plan is Planning to fail |
 |
|
|
madhu.paddu
Starting Member
6 Posts |
Posted - 2007-12-12 : 09:27:16
|
| hi friendsif am usingselect replace('srinivas reddy','srinivas','sreenivas');it replaceings all the strings with srinivas reddy in that cloumn.i have table consists of emp no ,ename,job columns.ename(column)srinivassrinivas reddymadhusudhansrinivasulusrinivasgoudin ename column i have to replace the srinivas by sreenivas.for this i had used this syntaxselect replace('srinivas%','srinivas','sreenivas') from xxxx;it giving result is srinivas%srinivas%srinivas%srinivas%srinivas%srinivas%srinivas%what can i do.regardsmadhunukala |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-12 : 09:28:34
|
quote: Originally posted by madhu.paddu hi friendsif am usingselect replace('srinivas reddy','srinivas','sreenivas');it replaceings all the strings with srinivas reddy in that cloumn.i have table consists of emp no ,ename,job columns.ename(column)srinivassrinivas reddymadhusudhansrinivasulusrinivasgoudin ename column i have to replace the srinivas by sreenivas.for this i had used this syntaxselect replace('srinivas%','srinivas','sreenivas') from xxxx;it giving result is srinivas%srinivas%srinivas%srinivas%srinivas%srinivas%srinivas%what can i do.regardsmadhunukala
Did you read my previous reply? MadhivananFailing to plan is Planning to fail |
 |
|
|
madhu.paddu
Starting Member
6 Posts |
Posted - 2007-12-12 : 09:32:03
|
| hi friendsthank you very much friends for clarifying my doubt.i got the solutionregradsmadhunukala |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-12 : 09:35:00
|
Always make sure you read the replies properly before asking additional questions MadhivananFailing to plan is Planning to fail |
 |
|
|
|