1

I want to change some Turkish characters to English for multiple columns' rows.

Lower case characters:

ç to c, ğ to g, ı to i, ö to o, ş to s, ü to u

Upper case characters:

Ç to C, Ğ to G, İ to I, Ö to O, Ş to S, Ü to U

For example:

A column which is include 'ARÇELİK' string value. The function which will be created should change this value to 'ARCELIK'

Thanks for your response.

3 Answers 3

1

I created a function to solve this issue.

My function is this.

CREATE FUNCTION REPLACECHARS(t1 varchar(100) CHARSET utf8) RETURNS varchar(100) CHARSET latin1 BEGIN declare s1 varchar(100) CHARSET latin1;

set 
s1 = REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(t1,'ç','c'),'ğ','g'),'ı','i'),'ö','o'),'ş','s'),'ü','u'),'Ç','C'),'Ğ','G'),'İ','I'),'Ö','O'),'Ş','S'),'Ü','U');

RETURN s1; END

Sign up to request clarification or add additional context in comments.

1 Comment

Not ideal solution but certainly time-being problem solver. Thanks.
0

Refer this link.Think it can help you.

Comments

0

You can use the REPLACE function for this.

SELECT REPLACE('ARÇELİK','Ç','C');

Now the Output would be ARCELİK.

Maybe you could put all the characters you want to replace in a table and then loop all of them through the REPLACE. I can't test this atm, it's just an idea i had in mind ;-)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.