Replace trademark/copyright symbols in string
shashank_p
Vertica Customer ✭
Best Answer
-
mosheg Vertica Employee Administrator
In addition if you want to replace all values in f1 consider something like the following.
UPDATE public.t1 SET f1=REPLACE(f1,chr(174),''); SELECT * FROM t1; f1 | f2 | f3 -------------+-------------+------------- solid works | solid works | solid works solidworks | solidworks | solidworks (2 rows)
5
Answers
We can do it with the exact string you want to replace as shown by default in f2
Or find the asci value of it like so: printf "%d\n" "'®"
Which is 174 and replace it like it is done by default in f3.
Great! it worked.
One question, how can I find asci value for such characters using DBeaver?
Please use the below query to find the ascii values of trademark characters in DBeaver.
dbadmin=> SELECT * FROM t1;
f1 | f2 | f3
---------------+-------------+-------------
solidworks® | solidworks | solidworks
solid® works® | solid works | solid works
(2 rows)
dbadmin=> select ascii(substr(f1,length(f1),1)) from t1;
ascii
174
174
(2 rows)
dbadmin=>
Thank you so much!