Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql uppercase to lowercase & vice versa

Status
Not open for further replies.

mama1

Programmer
Jul 12, 2002
3
GB
I am running mysql database with different records written using letters like č & š etc. Some of the records are written in uppercase while the others in lowercase. The database has a large number of records and there is no consistency between upper and lowercase. Is it possible to convert uppercase → lowercase & vice versa upon the retreival using upper(str) & lower(str) functions?
Another thing, would letters like č & š be automatically converted as well, or does this depend on 'current locale' system settings as it does with PHP where those letters would not be affected in case of 'English current locase' setting for example.

Any help is very much appreciated!

Thank you!
 
it depends on the current character set
i have now win1250 and such characters like è or š are converted without probs
 
i forgot to mention
run this query
SHOW VARIABLES;
there will be one variable called "character-set" and one called "character-sets"
when starting mysql u can use e.g. &quot;--default-character-set=<charset_name>&quot; to set your default character set to charset_name, must be one from character-sets variable
also look for the SET command syntax, there is the possibility to change character set

hope that helps
 
select ucase('tek-tips');
TEK-TIPS

select lcase('TEK-TIPS');
tek-tips

select lcase('Tek-Tips');
tek-tips

etc etc... ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top