Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace a string with another string like the Repalce func in Oracle

Status
Not open for further replies.

HariJana

Programmer
Oct 13, 2002
1
JM
Dear friends,
Greetings of the Day !

What is the function available in informix to replace a string with another string, like the
Replace(Column,<search string>,<new string>) this function is available in Oracle.

I wud like to know the Is similar function available in Informix. I have tried the same I am ggetting Replace procedure is not found.
Can anyboyd help me on this.

Thank you in advance
Have a Nice Time,
Hari
 
Hello,

You could use the decode function

I think the syntax is:

Select
DECODE(<column_name>,
<original_string1>,<replacement_string1>,
<original_string2>,<replacement_string2>,
<use_if_none_match>) <column_alias>
from <table>

Hope this helps

Dave
 
Hari,

If you are using 7.31 or upper version; you can use the inbuilt SQL function REPLACE same as Oracle.

REPLACE(source column,search_string[,replacement_string])

Regards,
Shriyan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top