Re: import data - how to change code page on the fly
> it is possible that the column definitions have latin2 encoding.
ok, i have checked with table definied as CHARSET=cp1250
import script is as follow:
SET NAMES cp1250;
SET CHARACTER SET cp1250;
LOAD DATA ...
flat file is saved as cp1250 for sure.
Error occured when script tried insert first column with character specified
to cp1250 code page and innconsistent with code page of database (latin2)
Ridiculous mysql message is "Data truncation: Data too long for column"
At the moment my workaround is to change code page of flat file before I
import them to the db but I believe that solution exists in mysql;)
regards,
R.
|