Forum Moderators: coopster
I am trying to update col_b where any of the values have an ascii value of č to c.
I have tried both replace and translate
$sql="update table_name set col_b = replace(col_b,'č','c')";
This seem to only work if the value is č and not if č exists in the string.
I want to replace all occurances of č to "c"
I appreaciet your help, thank you.
This seem to only work if the value is č and not if č exists in the string.
The syntax is correct and works in my tests.
SELECT col_b FROM table_name;What does your data look like and what do you want it to look like?
+-------------------------+
¦ col_b ¦
+-------------------------+
¦ this is the č text ¦
¦ č ¦
+-------------------------+
UPDATE table_name SET col_b = REPLACE(col_b,'č','c');
SELECT col_b FROM table_name;
+--------------------+
¦ col_b ¦
+--------------------+
¦ this is the c text ¦
¦ c ¦
+--------------------+
create table table1 (col_b char (40));How do you have the column defined?
insert into table1 values('this is the č text');
insert into table1 values('č');
select * from table1;
update table1 set col_b = replace(col_b,'č','c');
select * from table1;