Replace parts of a string [message #373435] |
Tue, 17 April 2001 04:29 |
Shannon
Messages: 4 Registered: April 2001
|
Junior Member |
|
|
Hi All
I need to replace "Smith & Western" for example with "Smith & Western". I am looking at the REPLACE method but it seems to want to replace the whole field
with the "&". Any Ideas?. Thanks
|
|
|
Re: Replace parts of a string [message #373436 is a reply to message #373435] |
Tue, 17 April 2001 05:19 |
Neal Hawman
Messages: 14 Registered: April 2001
|
Junior Member |
|
|
I'm not sure exactly what you're trying to do since your input and output look identical. But assuming you are "&" with "and" or something of that sort, there should be no problem.
If you are using SQL*plus, you will probably have to do a "set define off" to switch off the variable substitution. Other than that, it should work fine:
SQL> set define off
SQL> select replace('Fish & Chips', '&', 'and') from dual;
REPLACE('FISH&
--------------
Fish and Chips
|
|
|