I need to replace a path stored in an Oracle DB text field. However paths have been specified with different cases (ie MYPATH, MyPath, Mypath, mypath). When using a combination of REPLACE
and UPPER
, it does not work as I need it to, ie:
UPDATE Actions
SET Destination = REPLACE(UPPER(Destination), 'MYPATH', 'My_New_Path')
This does the replace but leaves everything in upper case - even for the rows where there is nothing to replace
BEFORE: MyPath\FileName
- AFTER: My_New_Path\FILENAME
BEFORE: DummyText
- AFTER: DUMMYTEXT
What I really need is to replace any occurrence of MyPath, regardless of the case to My_New_Path, without touching the casing on other rows or other part of the field
Any ideas? I have been scratching my head to no avail...
PS: Working with Oracle 9...