can you please post your format file, command line, the related lines (one good one bad) from input file, and output (table, again one good and one bad one)
Main Topics
Browse All TopicsI have an issue where there are null values in a txt csv file and they error out and won't populate the field as either null, or in this case since an integer, it should autofill it as zero.
I had this working on 2 other servers just fine, but recently moved to another server and setup the identical programs on the identical OS - (windows server 2003) and in this case it is giving me errors on an integer saying that '' is an incorrect integer value.
The same exact text file on my other server, just loads a zero where there is a blank... what setting do I need to mess with in order to correct this new server?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I have tried changing the default value of the field that needs to be an integer to zero even though on the other server its set as null and imports null values as zero anyhow.
The new server keeps erroring out. Here is the code I use to import... identical on both servers...
LOAD DATA INFILE 'c:/myfile.txt'
INTO TABLE mytable
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
The file itself is fine because when I change the field type to varchar it imports everything where it should be. The file is huge and will hard for me to single out the line as its somewhere deep in the file, but as an example...
if the headers were this..
Name, Age, email
values
chris,35,myemail@email.com
jane,,jane@jane.com
the 2nd record imports as a zero on the old server, but errors out with
"INCORRECT INTEGER VALUE '' FOR ROW 2" on the new server
I'm thinking there has to be some master setting that I maybe forgot to check on install or something that would make the behavior treat the empty field as zero for integer, or null for a string as I even read in the mysql docs that is supposed to be the default behavior
I did all that since I had it working perfect on another server, structure and everything else was EXACT, so I'm sure its something to do with a configuration of MYSQL setup, but can't find it... however...
I just solved the problem by googling it and found that changing the table structure to MyISAM instead of INNOdb made it work, even though the other server was innodb... I noticed it made it go lightning fast compared to INNODB. Is MyISAM the faster of the 2 because I always thought it was the other way around for some reason?
Can someone just tell me whats the diff between the 2 storage engines? whats more commonly used?
Thanks
Business Accounts
Answer for Membership
by: andre23Posted on 2009-10-26 at 20:30:58ID: 25668937
maybe you have a different table declaration? So the default value is different?
Hope to help.
Regards,
Andre