How do I import NULL

[expired user #2726]'s profile image [expired user #2726] posted 16 years ago in Import/Export Permalink
I'm trying to import a data set from a CSV file. This works correctly except that blank values don't get inserted as NULL. I have to manually set NULL (Shift+Ctrl+N).

Do I need to set a special character in the CSV or am I missing something?
ansgar's profile image ansgar posted 16 years ago Permalink
An empty value is not a NULL value, it's just an empty string, just like it gets imported. There is no way to detect a NULL value in a CSV file.
[expired user #2726]'s profile image [expired user #2726] posted 16 years ago Permalink
OK - thanks for the help. I'll look in to a CSV to SQL conversion to see if I can do it that way (unless there is a better method?).
ansgar's profile image ansgar posted 16 years ago Permalink
I guess if you do not find something related in the LOAD DATA documentation on www.mysql.com the chance is very low that somebody can fix it for you.
[expired user #2726]'s profile image [expired user #2726] posted 16 years ago Permalink
Thanks anse - this is exactly what I needed:
http://dev.mysql.com/doc/refman/5.0/en/load-data.html

Please login to leave a reply, or register at first.