Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




How To Specify Unicode Column?


When I create a table using the Create Table syntax, how do I specify that a column should hold unicode data?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Unicode Character Set
How can store  korean characters into mine Mysql databse and retrieve it back, without any losse of characters.

I mean when i am storing an aricle in non European language, and later retrive it on my website, it shows very strage characters or somtime this ?????? ???? ????.

Unicode (UTF8)
i have a problem with my MySQL 4.1.1a database an the unicode (UTF-8) data.
All send HTML document (charset=utf8) data, are stored in the following
schema ("#2350;#2366;#2350;#2381;..."). MySQL and the required datafields
are specified with utf8_general_ci.
How can I check if the send Data are correct stored in the MySQL database.
And how can I observe if MySQL gets and outputs the UTF8 data in the right way?

Unicode Signs
I'm working on the project that requires multi-lingual database ... I
have never done it before and i have problem to configure mysql server
and create databases which will allow me to store data in different
languages, which includes e.g. hebrew or arabic ...
I will be very gratefull if someone send me a dumped database with a
table containing couple of records (or more) of data in unicode - at
least i will have a starting point to find out what's wrong with my
project.

Unicode Woes With 4.1.7
I have data getting inserted to mysql 4.1.7 innodb tables with unicode characters such as: åæëïó

I have tried setting the character set for the tables to utf-8, macroman and macce, and re-inserting the data, with no notable change.

I don't know much about character encodings and multi-byte characters so any suggestions/advice would be greatly appreciated. I'm happy to provide additional data/table info if it would help.

Unicode For Russian
I just wanted to insert Russian data in my database but while I insert it it get inserted easily, since I believe the data is inserted in the default format i.e. UTF-8 Unicode (utf8) i believe this is the default format but when i select it from database i could not get what was desired what is the solution for this, I am using Php as server side language.I get? as a result of select and while i look it in phpadmin the result is the same, is this the browser problem...which is not supporting the font.

MySQL 4.1.x And Unicode (UTF8)
I have a problem with MySQL 4.1.x and UTF8. In version 4.0, i'm using html forms with utf8 charset for inserting unicode strings. but in version 4.1.x it is not working! if i change the charset of column,

ALTER TABLE `icons` CHANGE `name_farsi` `name_farsi` VARCHAR( 99 ) CHARACTER SET utf8 COLLATE utf8_persian_ci DEFAULT NULL

and change default charset of database like below code:

Retrieving Unicode Data
I have an existing JSP web application which retrieved data from a
SQLServer database and displayed it. The data contained Unicode chars. This
worked fine. I changed databases/JDBC drivers over to MySQL. I've set the
database to use utf8 and the tables as well. I've viewed the data in the
table and it contains unicode just fine, however, the query returns data
with all the unicode chars converted to question marks. I have searched for
a solution to this for hours and no luck so far.

I've tried passing in useUnicode=true and characterEncoding=UTF8 in the URL
connection string and this has done nothing. Then I read that by default
the driver has the useUnicode set to true. I tried setting it to false to
see if it would do anything. Nothing. Code:

How To Enter Unicode Strings?
How does one enter Unicode strings into a 5.0.3 MySQL table?

I tried things like:
INSERT INTO tablename(colname) VALUES( _utf8'€©®á§A¦n')
But this doesn't work. I guess I need an escape sequence, but the MySQL
manual doesn't specify Unicode escape sequences, just for quotes,
newlines and such.

Alias Using Unicode Character
how to use the micro sign in an alias? I want the column name to appear as "Chl (µg/L)".

Mysql (unicode UTF8)
i am tring to make a website which deal with hindi ( Indian language) . i want to know how i can use unicoad UTF8 with my sql.

Using 'N' Prefix For Unicode Strings
I have ported a .NET application which supports unicode from MS SQL Server
to mysql. The .net framework itself is unicode throughout and I am using
utf-8 innodb tables in mysql.

When working with mssql it was necessary to prefix unicode strings with N
e.g. N'a' when building the SQL to get them processed correctly. This
behaviour mostly seems to work in mysql unless there are single quote
characters in the string e.g.

insert into foo values ('a''b') -- works fine
insert into foo values (N'a''b') -- just inserts 'ab'

From reading the mysql manual I don't see any mention of the N prefix but
conversely the database engine doesn't seem to reject it.

Am I OK working with unicode strings in mysql without this N prefix? Any
idea why the prefix causes the quote processing to go wrong?

MYSQL And UNICODE (for Coldfusion)
I need to use a DB with UTF-8 encoding because of use off different languages...

I think it is best setting up your Mysql completely for UTF-8 or not ?
If you use UTF-8 do you always need to use VARBINARY and BLOB types in your table ?

When i retrieve DATA from a table i get wrong characters for special characters, i know that is a charsetproblem but all my pages are for UTF-8, connection coldfusion is with UTF-8 (standard) and mysql database has only charset utf-8 and UTF-8 collations, where is the tricky part ????

Are there simple examples to find on setting up a DB, see the CF sourcecode on the net..

Getting Unicode Back From Database
I am converting data from widestring to utf8 strings to try to get it onto MySQL, using Delphi's UTF8Encode and UTF8Decode functions. But it's coming back as gibberish.

I copied the word кодом from the russian page of the zeoslib site. Looking at the numeric values of the characters of that I got
043A, 043E, 0434, 043E, 043C, which corresponds with the Russian character chart on unicode.org. I converted that to utf8, which gave me:
D0,BA,D0,BE,D0,B4,D0,BE,D0,BC, which is a simple conversion.
That was then saved to the database. So far so good.

But when I read that back, it came back as
C3,3F,C2,BA,C3,3F,C2,BE,C3,3F,C2,B4,C3,3F,C2,BE,C3,3F,C2,BC, i.e. four groups of four bytes, where the last of each group correspond with the 2nd char of the utf8, but the other 3 are not useful. (3f = '?').

And when I pass that to UTF8Decode I get a blank widestring returned.

So, I can't do much with it as is. Does anyone know what's going on? And more importantly, what is the right way to get unicode into and out of a database? I'm using MySQL 4.1.3b for Windows, with the latest zeos components.

Searching In Unicode Columns
I'm trying to do a search in a column which contains unicode strings.
It works allright for english keywords but it doesn't work for unicode characters.

I'm using:
SELECT * FROM `Customers`
WHERE city = 'تهران';


I would use N function if I was using MS SQL SERVER,

It would be like this in MS SQL SERVER:

SELECT * FROM `Customers`
WHERE city = N'تهران';

How can I do that in MYSQL?

Retrieving Unicode Data
I have an existing JSP web application which retrieved data from a
SQLServer database and displayed it. The data contained Unicode chars. This
worked fine. I changed databases/JDBC drivers over to MySQL. I've set the
database to use utf8 and the tables as well. I've viewed the data in the
table and it contains unicode just fine, however, the query returns data
with all the unicode chars converted to question marks. I have searched for
a solution to this for hours and no luck so far.

I've tried passing in useUnicode=true and characterEncoding=UTF8 in the URL
connection string and this has done nothing. Then I read that by default
the driver has the useUnicode set to true. I tried setting it to false to
see if it would do anything. Nothing.

Then I came across this:

http://lists.mysql.com/java/7098

I don't know anywhere else to ask this. Even though it may not be MySQL's
problem but the driver I don't see any forums for the MySQL driver.

Unicode Encoding Script
I have been in trouble since last few days. I have developing an web application which interacts MySQL from a jsp page. My mySQL table contains a column to store bengali word.

I can enter bengali word manually using bengali keyboard. And I can also retrieve bengali word in my jsp page and display it properly. But when I try to insert bengali word from my jsp page using ...executeUpdate("insert....."), it shows some characters like ???(+ some random character). My table supports UTF-8 also.

Unicode Exact Match
I am building a website partly in chinese. I want to perform searches using pinyin denotation (which for example represent the different chinese tones as "shÄ«, shí, shÇ, shì, shi"). My database is all in UTF-8. I want to find a way where:

SELECT * FROM table WHERE fieldname='shī'

returns exact matches of 'shÄ«'. What I now get instead is an interpretation where every form ("shÄ«, shí, shÇ, shì, shi") is returned. Is there any way to solve this problem?

Chinese/Unicode From Php And Mysql
I searched the forum regarding this problem already and attempted to solve the problem, but fail regardlessly.I entered chinese characters directly into a table column A which has collation utf8_unicode_ci using phpmyadmin. The chinese/unicode characters actually appeared in phpmyadmin's "select * from tableT".

However, when I create a php script with a query "select * from tableT", it appears in the form of question marks e.g. ????.Any idea how to resolve this? If I can view the chinese characters in phpmyadmin via the web browser, it shouldn't be a problem to display it in a php file, right? Not sure whether this is a php or a mysql problem.

Manipulating Unicode Characters
Apart from "sort by" the Hindi language (unicode) text does not behave when stored in MySQL database. For e.g.

length( first_name ) || lower( first_name )
15 || गीताई
It is in fact 3 characters.
Is there a way I can use the standard functions and get the correct results?

Unicode Character Display
i've converted by tables to unicode and I added a japanese word in japanese script (using phpMyadmin), it displays correctly on the page, although in the database it displays as:

&#24195 ; &#21578 ;& #26989; (I added spaces before the ; in this posting so that it displays the code and not the japanese symbol)

this is the way it should be? Or is it possible to read the japanese script in the database as well?

Non-ascii And Non-unicode Strings
Does anyone know a function(s) that can do either non-ascii or non-unicode string search in a VARCHAR field?

Unicode And Japanese Support
I am using cold fusion to make a small custom website using
mysql to store the information a user inputs. I want it to
be able to save japanese and unicode text, but whenever I
enter any it comes back as garbage. Is there anything
special I need to do to configure mysql to use unicode

Inserting Unicode In Table
I have created a table as follows -

CREATE TABLE verb_table (verb VARCHAR(25), briathar VARCHAR(25), conjugation VARCHAR(5), past_tense VARCHAR(25), aimsir_chaite VARCHAR(25)) TYPE=InnoDB CHARACTER SET utf8;

Now how do I insert unicode values into a database using the following format -

insert INSERT INTO MyFirstTable ("To run","rith","1","ran","rith");

How do I escape a unicode value?
For example, how do I insert a "long r" (u027c) in place of a normal r in the example above?

UCS2 - Unicode In MySQL Is A Myth
I have tried and failed to create, insert and retrieve UCS2 data into a MySQL 4.1 database. I believe 16 bit Unicode in MySQL is an untested and un-implemented MySQL feature.

The MySQL Administrator (version 1.0.14) allows you to specify unicode attribute (checkbox) however, after a reload the unicode checked checkbox magically looses its check. Interesting and in my opinion deliberate.

Install MySQL With Support For UTF-8 Unicode
How do I install MySQL on a Windows PC so that it will support characters that conform to UTF-8 Unicode.

Setting Up Mysql Tables For UNICODE
I am willing to setup my MySQL tables so they can hold international
strings (English, French, German and Spanish). I understand that
Unicode character coding is a good candidate to do so.

Currently I use the default character set and it looks like it does
not like characters such as "é", "ô" .etc... (they come up as strange
characters probably indicating that the code of the character has been
truncated).

Is my understanding correct? If yes, could anyone lead me through on how to create such tables coding text as Unicode?

I went through the MySQL administration guide but cannot get a clear
understanding on how this is supposed to be performed.

Ideally I would like to setup the MySQL *server* for it to process the
tables with the Unicode character set *by default * (rather than
specifying each tables one by one as using Unicode encoding).

Enable Unicode In MySQL 4.1.0-alpha
I have read that Unicode (UTF-8) was not enabled by default in the
mysql-4.1.0-alpha binaries. How can I enable it? What should I change in the
code to do so?

Search With Unicode Characters In A Table.
I wanna search in a table with unicode characters:

SELECT * FROM `Customers`
WHERE city = 'تهران';

I would use N function if it was MS SQL SERVER, it would be like

SELECT * FROM `Customers`
WHERE city = N'تهران';

How can I do that in MYSQL?

Full-Text For InnoDB & Unicode
As far I remember full-text doesn't work with utf-8. Anybody knows the estimated time when it will be supported ?? I next few months 4.1 version will be ready to use (I hope so...) and I wish to use utf-8 charsets, but very important issue is full-text search.

I'm also curious with InnoDB support for Full-Text search.



Inserting Unicode Data In Forms6i
i m using forms 6i with oracle 10g.
i have set Nls_lang =American_America.UTF8.
Now my problem is when i type some data i marathi Using a font
converter engine directly into the text box on form i just get
?in the text box.

when i type same data on notepad n then paste it in textbox it gets
properly pasted and also get inserted in oracle.I m also able to
retrive it back properly.So i think it is not the problem of my
character set.Also i have set the font of textbox as Arial Unicode Ms.
i m not getting where the problem is?

Mysql 4.1.11 Unicode Problems With Some Characters
I've had a long battle with displaying unicode from mysql 4.1. I've had it working locally to test but many characters (some japanese and russian) dont display correctly.

I've narrowed the problem down to the database itself. If i connect from my hosting provider to my home computer database, it works fine:

http://www.spainexchange.com/test.php

but when conecting from my hosting provider to the database on my hosting provider - you can see the character display has problems:

http://www.spainexchange.com/test_remote.php

We are using the same version of mysql, except they are on freebsd linux and i am on windows. Can anyone see where the problem may be?

MySql Problem With Unicode, MySql Connector/Net And C#
I have a problem regarding unicode characters and MySql.
I am using MySql 4.1 and MySql Connector/NET together with
C#.

My question is whether I' am making a silly mistake (or not),
by not being able to store unicode characters in a simple table.

The database I have created is supposed to be in unicode:
'CREATE DATABASE test CHARACTER SET utf8'.

Now, connecting from C#, i am trying to write into a simple
table, with one column, the value 'u0120u0121u0125u0411'
but when I am retrieving the value from the table, '????' is
returned as a result.

I don't know if its relevant, but i have checked that the
server and connection are using unicode encoding:

SHOW VARIABLES LIKE 'character_set_server' which returns
'utf8' as a result.

also:
SHOW VARIABLES LIKE 'character_set_connection' returns
'utf8' as a result.

Selecting Records, Then Summing Parts Of A Column, Then Sorting By That Column...
I’m keeping track of baseball stats, and each row represents one line of stats (from a box score) for one player of a single game. Because of this, a single player may have multiple rows in the table. I want to cumulate each player’s stats (so they’ll be one row per player) and display as output, which isn’t a problem. Then I want sort by a certain stat, but by now I’ve already looped through the table, so I can’t sort using a mySQL query at this point. I tried first putting values into an array in a previous project, but that became extremely complicated. What’s the best way to approach this?

Update Part Of Column Into Another Column
I'm looking for a way to update a SQL column with a portion of info from another column in the same table.

example of a sql command
--------------------------
UPDATE table1
SET table1.columnname1 = table1.columnname2
FROM table
WHERE blah blah blah

Here's the thing... I only need a portion of the data found in the source column. I'm not sure how I would do this then.

for example, the database has countries and states combined into one column like this 'US-DC', 'US-CA', US-FL', etc. I want to separate these into two columns, a country column and a state column.... and I dont want to go though all the results and do this line by line. How would I write the SQL command so that it puts just the country in the country column, and puts just the state in the state column, and it omits the dash all together.

any ideas?

Differentiate Between Column Alias And Other Column With Same Name
Sample SQL:
SELECT
a,
(SELECT a + 3) AS b,
(SELECT y FROM t2 WHERE b = b)
FROM t1

1. SELECT a + 3 will calculate a column with alias b
2. t2 has a column named b

Question: How can I differentiate between column alias b and t2.b. MySql treats alias b as t2.b in statement (SELECT y FROM t2 WHERE b = b)

Using Table A Column Row Data For Table B Column Headings
Is it possible to add column data in table A and have (dynamically
linked) table B column headers?

Using Table A Column Row Data For Table B Column Headings
Is it possible to add column data in table A and have (dynamically
linked) table B column headers?

Column = Column + 0
Is column = column + 0 allowed as part of a MySQL query?

I am experiencing problems using it, but I can't be sure if it is that or something else in the code..

Add A Column
is there a way to add a column to an existing table?

Add New Column
I Want To Add New Colume In Exitsing Table Which Have 3000 Records New Columns Not Contain Null Values
How To Add Then Not Null Column In Exitsing Table

My Own Column
This is my first time using MySQL and I need to know how I can add in my own boolean column to the select statement so that I can bind a gridview checkbox to it.

Max Of A Column Where ...
How can I select , for a given name, that record with the highest id for
something like:

id INTEGER(11) PRIMARY KEY NOT NULL AUTO_INCREMENT
name VARCHAR(40)

I want to select the highest id where name='something'. I've tried along the
lines of:

select MAX(id) as id where name='something'

but with no success.

I know this is oversimplified -Ive stripped it down here intentionally to
try to determine how you select for a given row where a particular integer
value is the max value.

Column Name
is there any way to select a column name rather than the values stored in it?

Name Of A Column
how can i find the name of a column using mysqli?

Row Into Column
i have this structure of tables:

tehnic_detalis(id_detail, detail_name)
products(id_product, id_detail, detail_value)

I wish is to transpose row from tehnic_detalis into column for products in something like this short_description(id_product, detail_name1, detail_name2...)

Can You Add A Column?
Is it possible in a SQL query to have it select all entries for one coloumn and add them together? instead of looping?

Column Name
I created a database, then when I tried to create a table, one of my column names was supposed to be UNION (as in labor union). I kept getting a sytax error until I removed it. Then it worked fine. Anyone know why?

Column Name Containing . (dot)
I have a query that contains some column names with a dot (.) as part of the column name. How can I select these columns in another query?
Example: The first column is 'Name', the second 'Name.Old'
Now:
SELECT * FROM (qryName) works fine.
SELECT Name FROM (qryName) works fine.
SELECT Name, Name.Old FROM (qryName) does NOT work.

Add A Column
I need to know how to add a column of numbers and get a total using my sql
command.

SELECT v.vid, title, purchdate, sum(cost) AS Total
FROM Video v, Vidcopy vc
WHERE vid.v = vid.vc

I need to know how to add the cost column and get a total.


Copyright © 2005-08 www.BigResource.com, All rights reserved