jayjayreddick
jayjayreddick

Reputation: 49

MYSQL importing blank values

I am attempting to import a CVS file that contains blank values but when I import them, they are replaced with zeros. (i.e. a cust_referred_by field that is blank is replaced with 0 in MySQL). I would like them to show blanks in my SQL.enter image description here

Upvotes: 0

Views: 207

Answers (1)

Wouter van Nifterick
Wouter van Nifterick

Reputation: 24086

Make sure that your field is nullable.

If it's not, then run something like this to fix it:

ALTER TABLE my_table MODIFY cust_referred_by INT;

Also, depending on the way you do your import, you might be able to define how NULL values are provided.

Upvotes: 1

Related Questions