Questions tagged [collate]

Is a clause that can be applied to a database definition or a column definition to define the collation, or to a character string expression to apply a collation cast.

Is a clause that can be applied to a database definition or a column definition to define the collation, or to a character string expression to apply a collation cast.

COLLATE (Transact-SQL)

164 questions
1
vote
1 answer

How to use COLLATE in MySQL prepared statement

I need to specify COLLATE in connection with LIKE inside a prepared statement inside a stored procedure, e.g. LIKE ? COLLATE utf8_unicode_ci. I'm getting the following error: COLLATION 'utf8_unicode_ci' is not valid for CHARACTER SET…
1
vote
1 answer

how set collate = true while printing using gsprint

public void PrinterThread(string printerName, string fileName, bool portrait,string Copies) { string gsArguments, gsLocation; ProcessStartInfo gsProcessInfo; Process gsProcess; if (portrait) { //gsArguments =…
1
vote
2 answers

COLLATE issue on joining across 2 database on same SQL.Server

I keep getting this error: Cannot resolve the collation conflict between "Latin1_General_BIN" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation. I am not sure how to fix it. I am joining across two different databases on the same…
user4309564
1
vote
1 answer

Mysql Index COLLATE utf8_unicode_ci

I updated database from freeradius and now there is a sql sentence that take more tan 30 seconds to execute while before takes only 0,5s to execute. This is the OLD definition tables: CREATE TABLE `radacct` ( `radacctid` bigint(21) NOT NULL…
Oscar Jofre
  • 153
  • 3
  • 17
1
vote
1 answer

how to upper a column with collate in SQL SERVER

We are doing an integration between two software, I am trying to convert a column to uppercase in select statement but Turkish characters get converted wrong. Iknow to use "collate" in where clause but can I use it in "select upper(col1) from…
Arif YILMAZ
  • 5,754
  • 26
  • 104
  • 189
1
vote
2 answers

PHP string is not converted to utf 8 when selected from mysql

I have the following script: header('Content-type: text/plain; charset=utf-8'); $rq = "SELECT `name` FROM `mapamond_countries` WHERE `id` = 93"; $str = $db->GetAll($rq); var_dump($str[0]['name']); var_dump("شيلى"); The string شيلى is copy…
zozo
  • 8,230
  • 19
  • 79
  • 134
1
vote
1 answer

SQL converting column from Latin1 to UTF8

I am trying to convert a specific column in a table on my DB from latin1 character set with collation latin1_swedish_ci to utf8 with collation utf8_unicode_ci. COLUMN: description, type: longtext, default not null I tried the following commands on…
tracyfan_1
  • 15
  • 1
  • 5
1
vote
0 answers

Problems making query using accents PDO

I have the following problem: I reated the following db and table: CREATE DATABASE `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; CREATE TABLE IF NOT EXISTS `tabCCs` ( `Cod` int(10) NOT NULL UNIQUE, `Nome1` varchar(20) NOT NULL, …
Pavão
  • 11
  • 2
1
vote
1 answer

Making SQL password query case sensitive using COLLATE

I am using the following SQL code in my VB in VS2013. I want to create a login form using a database of users stored into a UserList. However The query is not case sensitive. How do I change my query string to use COLLATE or any other case sensitive…
Joey Pinto
  • 1,735
  • 1
  • 18
  • 34
1
vote
2 answers

Transact-SQL collate doesn't work

I'm trying to use PATINDEX function like this: select PATINDEX('%[A-Z].%', 'he.llo MA. asd ' collate Cyrillic_General_CS_AS) I expect it returns 9 but it returns 2. Can someone enlight me what's wrong? I also tried to supply collate in first…
heximal
  • 10,327
  • 5
  • 46
  • 69
1
vote
1 answer

Is there any point of using COLLATE per column when creating tables?

I just did an export of a MySQL database in order to duplicate it on another server. Looking at the sql script I see the following: CREATE TABLE `X` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) COLLATE utf8_unicode_ci…
Steven
  • 19,224
  • 47
  • 152
  • 257
1
vote
1 answer

std::collate::transform caused segmentation fault

When I run the following source code, got "Segmentation fault (core dumped)" at line#3 char s[] = "helloworld"; const std::collate* pc = &std::use_facet >(std::locale("en_US")); std::string str = pc->transform(s, s +…
songyuanyao
  • 169,198
  • 16
  • 310
  • 405
1
vote
2 answers

MySQL SELECT statement with COLLATE and MATCH

Is there any way to specify COLLATE and MATCH() AGAINST() in the same query string. I'm trying to get this. SELECT * FROM table WHERE COLLATE latin1_general_cs MATCH(column) AGAINST('string') I know that won't work, just an example. If COLLATE…
1
vote
1 answer

Mixing HQL with SQL in a single query

I have a HQL query that uses data across several tables to pull in a list of objects. Part of the query requires case-sensitive comparison, but the default collation on the database is case insensitive. I know that I can convert the query to SQL I…
David Mason
  • 2,917
  • 4
  • 30
  • 45
1
vote
2 answers

Loss of Unicode data - due to collation change?

I had a table with a collation of Thai_CI_AS which did not store special characters like à properly. When storing à it gets rendered as a question mark: ? I have solved the problem by changing the collation of that table to default which is…
nambla
  • 71
  • 2
  • 11