collation

Why can't I use a specific collation in MySQL?

♀尐吖头ヾ 提交于 2019-12-10 23:23:00
问题 I have a table with the character set latin1 (checked by show variables like "character_set_database"; ) and a default collation of latin1_swedish_ci (checked by SHOW TABLE STATUS; ). I'd like to run a query using the collation latin1_general_cs , which is compiled on my system (checked by Show collation LIKE "%_cs"; ): select * from myTab WHERE col RLIKE '[[:upper:]]' COLLATE 'latin1_general_cs' LIMIT 10; which gives an error: ERROR 1253 (42000): COLLATION 'latin1_general_cs' is not valid

Turkish character encoding with MySQL

梦想与她 提交于 2019-12-10 22:27:50
问题 I'm having issues with turkish characters as I mentioned in title. I created a function on MySQL: DELIMITER $$ CREATE DEFINER=`root`@`localhost` FUNCTION `ilgiAlaniFunc`( idKullanici INT, ilgi_alani_ismi varchar(255) CHARSET utf8 COLLATE utf8_turkish_ci ) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_turkish_ci READS SQL DATA DETERMINISTIC BEGIN -- Function logic here DECLARE ret int DEFAULT -1; select id Into ret from ilgi_alanlari where ilgi_alani_adi=ilgi_alani_ismi limit 1; IF(ret = -1)

What are the advantages and disadvantages of explicitly specifying collation in table creation scripts?

℡╲_俬逩灬. 提交于 2019-12-10 21:09:56
问题 When creating a table, the COLLATE clause is optional. So, in: CREATE TABLE T1 ( F1 varchar(50) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, F2 varchar(50) NOT NULL ) the collation of F2 will be determined by the database default. In the past our team always used the default collation. However, we now have a few columns where we need to explicitly specify collation. We are considering whether to change our standard to always specify collation and looking for any additional information that

SQL Server - Is there a collation that provides natural order for numbers?

蓝咒 提交于 2019-12-10 20:09:42
问题 I'm using SQL Server 2008. I have a table with a column of type VarChar . It is currently filled with strings which actually represent numbers. Unfortunately, the column must remain VarChar ('1', '2' ... , '1000' ) . I wish to query that field for the max number value but since this is a VarChar I get the Lexicographical max and not the natural order max. I thought I'll try and solve this by using the COLLATE clause for that query and change to a collation that provides numerical natural

Which MySQL collation compares e.g. é and e as equal?

我与影子孤独终老i 提交于 2019-12-10 20:07:43
问题 EDIT: if no such collation exists, I can work around it if MySQL has a function which will convert strings into ASCII equivalents e.g. FUNC('Være')='Vaere' -- there might be several such functions, one for each alphabet, which would be a hassle but acceptable if effective. I need a MySQL5 collation which will compare accented characters as equivalent, irrespective of accents. e.g. "fêter" should be considered equal to "feter" and "eł" should match "el" Ideally this wouldn't be limited to

Effects of updating a table with rows from utf8_turkish_ci to utf8_general_ci?

眉间皱痕 提交于 2019-12-10 19:07:39
问题 I was unable to join some tables because some of the tables/rows were utf8_general_ci and some were utf8_turkish_ci. Thus I had to dublicate the turkish one, convert it to general and finally use it. However I wonder, what will happen to my application if I convert the original table from turkish to general? I use MySQL with PHP. This was the initial error: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_turkish_ci,IMPLICIT) for operation '=' 回答1: Your columns' data are stored

Postgresql COPY encoding, how to?

落花浮王杯 提交于 2019-12-10 17:29:52
问题 I am importing a .txt file that contains imdb information(such as moviename, movieid, actors, directors, rating votes etc) I imported it by using the COPY Statement. I am using Ubuntu 64 bit. The problem is, that there are actors having different names, such as Jonas Åkerlund. That is why postgresql throws an error: ERROR: missing data for column "actors" CONTEXT: COPY movies, line 3060: "tt0283003 Spun 2002 6.8 30801 101 mins. Jonas Ã" ********** Error ********** ERROR: missing data for

INSTR(str,substr) does not work when str contains 'é' or 'ë' and substr only 'e'

让人想犯罪 __ 提交于 2019-12-10 16:55:13
问题 In another post on stackoverflow, I read that INSTR could be used to order results by relevance. My understanding of col LIKE '%str%' and INSTR(col, 'str')` is that they both behave the same. There seems to be a difference in how collations are handled. CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO users (name) VALUES ('Joël'), (

Unicode characters causing issues in SQL Server 2005 string comparison

好久不见. 提交于 2019-12-10 15:39:06
问题 This query: select * from op.tag where tag = 'fussball' Returns a result which has a tag column value of "fußball". Column "tag" is defined as nvarchar(150). While I understand they are similar words grammatically, can anyone explain and defend this behavior? I assume it is related to the same collation settings which allow you to change case sensitivity on a column/table, but who would want this behavior? A unique constraint on the column also causes failure on inserts of one value when the

Problems with Turkish SQL Collation (Turkish “I”)

不问归期 提交于 2019-12-10 14:51:19
问题 I'm having problems with our MSSQL database set to any of the Turkish Collations. Becuase of the "Turkish I" problem, none of our queries containing an 'i' in them are working correctly. For example, if we have a table called "Unit" with a column "UnitID" defined in that case, the query "select unitid from unit" no longer works because the lower case "i" in "id" differs from the defined capital I in "UnitID". The error message would read "Invalid column name 'unitid'." I know that this is