troubleshooting Question

How to replace in ORACLE a substring with another substring in a UPDATE/REPLACE statement

Avatar of WARTELLE
WARTELLEFlag for France asked on
HTMLSQL
2 Comments1 Solution720 ViewsLast Modified:
I need to REPLACE a substring 'fi' by another (i.e. 'fi') in a VARCHAR2 field
The pb for this REPLACE is that Oracle wants to interpret the string as a substitution...
How do you bypass the substitution to be interpreted as literal characters ?

I use Oracle 9i

Thanks for your help
Vincent
Substr1 = 'fi'
Substr2 = 'fi'
 
UPDATE FACILCATPRODITEM SET item_desc = REPLACE(item_desc, 'Substr1', 'Substr2') 
  WHERE dbid = '#variables.iDBID#' 
    AND cat_id='#variables.iCatID#'
    AND prod_id='#variables.iProdID#'
    AND item_xml_tagname = '#variables.XML_TagName#'
    AND item_langue = '#variables.CAT_LANGUE#'
    AND item_actif = '1'
    AND item_type = 'TXT'
ASKER CERTIFIED SOLUTION
Muhammad Khan
Manager, IT

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros