I am using oracle, toad.
I want to replace , with backspace.
Column consists of: bla bla foo ,CALL HELPDESK
It has to replace: bla bla foo CALL HELPDESK
Basically , should be removed
I tried like this:
UPDATE Mytable t
SET column = REPLACE(t.U_MSG, ''%, CALL HELPDESK'', '% CALL HELPDESK')
SQL Server REPLACE() FunctionThe REPLACE() function replaces all occurrences of a substring within a string, with a new substring. Note: The search is case-insensitive. Tip: Also look at the STUFF() function.
Oracle REPLACE() Function This function is used to replace the sequence of character with another character in the given string.
function deletePrefix(stringName in varchar2) return varchar2 is begin return regexp_replace(stringName, '^[a-zA-Z]+_', ''); end; regexp_replace(stringName, '^[a-zA-Z]+_', '');
REPLACE
doesn't use wildcards, it simply replaces all instances of the first string with the second string. This should work:
UPDATE Mytable t
SET column = REPLACE(t.U_MSG, ', CALL HELPDESK', ' CALL HELPDESK')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With