Yes. Combination of stuff, charindex works.
See example:
http://www.experts-exchang
Main Topics
Browse All TopicsThere doesnt appear to be a REPLACE(str1,str2,str3) function in sybase. There must be an equivalent function to replace a string of chars (str2) with a new string of chars (str3) in a string (str1)
Whats it called and whats the format?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Yes. Combination of stuff, charindex works.
See example:
http://www.experts-exchang
thanks to you both,
Its a definate downfall of sybase that it doesnt provide such a basic function that most people take for granted !!!
I had figured out about using stuff with charindex but was convinced that Sybase would have a replace function, only it was named something else, People can give out about MS but they come up with the goods !!!
Here is the docs for str_replace()
http://infocenter.sybase.c
Business Accounts
Answer for Membership
by: alpmoonPosted on 2004-04-06 at 17:35:13ID: 10770984
You can use stuff (there are more details in reference guide):
Returns the string formed by deleting a specified number of characters from one string and replacing them with another string.
Syntax :
stuff(char_expr1 | uchar_expr1, start, length, char_expr2 | uchar_expr2)
Parameters :
char_expr1
is a character-type column name, variable, or constant expression of char, varchar, nchar or nvarchar type.
uchar_expr1
is a character-type column name, variable, or constant expression of unichar or univarchar type.
start
specifies the character position at which to begin deleting characters.
length
specifies the number of characters to delete.
char_expr2
is another character-type column name, variable, or constant expression of char, varchar, nchar or nvarchar type.
uchar_expr2
is another character-type column name, variable, or constant expression of unichar or univarchar type.
Examples :
Example 1
select stuff("abc", 2, 3, "xyz")
----
axyz
Example 2
select stuff("abcdef", 2, 3, null)
go
---
aef
Example 3
select stuff("abcdef", 2, 3, "")
----
a ef