Importing CSV with NULL values to a Table
I am using the "Table Data Import Wizard" to input a csv file containing columns of number data.
Some cells are NULL, and have in them the characters NULL.
When I start the wizard all the "Field Types" are given as "text", and I can see the NULL entries in the preview pane.
I then change them to "int" or "double". and
I have the "Encoding" at utf-8.
I then run through the rest of the wizard.
The imported data no longer has the NULL data, all the rows with any NULL values were dropped.
If I import with all the "Fields Types" set to "text" I get all the rows, but then I can't treat the values as numbers for operations in MySQL, correct?
I tried changing the "Field Types" to "int" or "double" after importing as "text" but was greeted with errors:
ALTER TABLE tablename MODIFY columnname INTEGER;
Error Code: 1265. Data truncated for column 'columnname' at row 1 0.024 sec
Any ideas as to what I should do?
Thanks
Subject
Views
Written By
Posted
Importing CSV with NULL values to a Table
20290
June 05, 2018 11:17AM
6789
June 08, 2018 12:06PM
5702
July 20, 2018 06:35AM
4436
August 11, 2018 03:36AM
3763
April 02, 2019 12:55PM
2506
August 08, 2019 08:40PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.