Dear all,
I want to replace the first of @ by # in the data
Example
abc@0001@1234 -> abc#0001@1234
Best regards
Gab
Printable View
Dear all,
I want to replace the first of @ by # in the data
Example
abc@0001@1234 -> abc#0001@1234
Best regards
Gab
you can use strreplace to replace the character
You can use INSTR function to find N-th occurence of a character within a string. In your case you would use
REPLACE (SUBSTR('abc@0001@1234', 1, INSTR('abc@0001@1234', '@', 1, 1), '@', '#') ||
SUBSTR(SUBSTR('abc@0001@1234', INSTR('abc@0001@1234', '@', 1, 1)+1)
If you would like to replace the first *two* occurances of '@' you would change '@', 1, 1 to '@', 1, 2 inside the INSTR functions.
HTH,
Dear sir,
What is the "strreplace" command?
Could you tell me the detail?
Best regards
gab