Page 1 of 1

Convert db encoding

Posted: Fri Nov 12, 2004 11:04 am
by MarK (CZ)
Hi again :D

I'm trying to convert my db encoding but it seems that the CONVERT function isn't working (or I can't handle it).

This is my SQL query:

Code: Select all

SELECT CONVERT(`text` USING latin2) FROM `news`;
And this is the error returned:

Code: Select all

#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING latin2) FROM `news` LIMIT 0, 30' at line 1
What am I doing wrong?? :?
Thx in advance.

Posted: Sun Nov 14, 2004 12:13 pm
by jl
If news is a table name it shouldn't have quotes. If text is a field name it shouldn't have quotes. Wouldn't have thought that would produce that error though, but correct it first.

Posted: Sun Nov 14, 2004 4:48 pm
by MarK (CZ)
Thx for reply,
actually I've already tested it both with and without 'quotes'. These are grave accents (I'm not sure if they can be called quotes) and they should work around table or column names.

Anyway, the problem remains. Can anyone help? Please!

Posted: Mon Nov 15, 2004 3:25 pm
by emperor
Check which version of MySQL you have - the manual sez: "The USING form of CONVERT() is available as of 4.1.0"

Posted: Tue Nov 16, 2004 5:35 am
by MarK (CZ)
That's probably the problem (my SQL says 4.0.18-nt), thx for the tip, I'll try to upgrade MySQL server ;)