Stefano,

The behaviour you are describing is normal, assuming that the column in your
MySQL table is defined as CHAR(255) or VARCHAR(255).

You didn't say which version of MySQL you are using. However, unless you are
using MySQL 5.0.3 or later, 255 is the largest size available for a CHAR or
VARCHAR column. (Starting with version 5.0.3, the maximum size of a VARCHAR
is 65,536.)

Assuming you are not on 5.0.3 or later, you should change your table
definition to use one of the BLOB or TEXT datatypes: TINYBLOB, BLOB,
MEDIUMBLOB, LONGBLOB or TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT. You should
look at the definitions of these column types in the manual -
http://dev.mysql.com/doc/mysql/en/storage-requirements.html - to see which
one best
suits your requirements; only you know the largest value that you want to
store in the column. Basically:
- TINYBLOB and TINYTEXT are for values less than 256 characters long (which
is no better than CHAR or VARCHAR in your case)
- BLOB and TEXT are for values less than 65536 characters long
- MEDIUMBLOB and MEDIUMTEXT are for values less than 16777216 characters
long
- LONGBLOB and LONGTEXT are for values less than 4294967296 characters long

Rhino

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Saturday, April 02, 2005 6:51 AM
Subject: Load data infile and text fields


First of all I hope you can be patient for my english....
I'm working with data import into mysql from a txt file. I'm using LOAD
DATA INFILE
command but I cannot correctly import a text column of 595 characters.
I receive this (very large) file from an external organization and this
file is made
without separators bitween fields. I know only the exact lenght of each
field. All is fine for fields < of 256 char, but I cannot import this text
field of 595 characters. It's imported truncated at 255th character.
Help me please!
Stefano (osso)





-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.1 - Release Date: 01/04/2005


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to