Hi I am trying to build a MySQL database. I have made a table where some fields are VARCHAR and others are INT. All of them are null. One of the columns I made is Vote which is INT(5).
Now I am trying to import data from a text file. The problem is, some of the rows in the column Vote are blank.
As a result, MySQL giving me ERROR 1366 which says the following:
"Incorrect integer value: ' ' for column 'Vote' at row 1"
Tried making the column NOT NULL using the ALTER TABLE command..didn't work..
Would you please tell me how to fix it?
Jump to Post
Try creating a table having the same column names whose columns are all VARCHAR and import your data into that. That should work as long as your VARCHAR columns are big enough. Then you can write a query that reads the data from this all-VARCHAR table and INSERTs into the …
Jump to Post
If you have generated the text file on a Windows system, you might have to use LINES TERMINATED BY '\r\n' to read the file properly, because Windows programs typically use two characters as a line terminator. Some programs, such as WordPad, might use \r as a line terminator when writing …
All 8 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.