I am trying to load data stored in UTF-8 text files and I have two problems. First, there is currently no primary key set in this table, and it does not set auto-increment or force null at this point; the first column will be the intended primary key after all data has been loaded, and foreign keys will be added to this point.
I got the following error:
25 rows, 1 warning (s): 1366 Invalid integer value: '1' for the column 'idtable_file' in row 1 Entries: 25 Deleted: 0 Missed: 0 Warnings: 1
when trying to accomplish this:
LOAD DATA LOCAL INFILE '/path' INTO TABLE sandr.table_file
columns terminated by ','
LINES terminated by '\n'
(idtable_file, owner_id, folder_id, @modified_date, @created_date, size, filename)
SET modified_date = STR_TO_DATE(@modified_date,'%d/%m/%Y %T'),
created_date = STR_TO_DATE(@created_date,'%d/%m/%Y %T')
in this table:
CREATE TABLE `table_file` (
`idtable_file` int(11) DEFAULT NULL,
`owner_id` int(11) DEFAULT NULL,
`folder_id` int(11) DEFAULT NULL,
`modified_date` datetime DEFAULT NULL,
`created_date` datetime DEFAULT NULL,
`size` int(11) DEFAULT NULL,
`filename` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
- , MySQL, , - ? , SQL- PowerShell, :
LOAD DATA LOCAL INFILE '/path' INTO TABLE sandr.table_file
columns terminated by ','
LINES terminated by '\n'
:
ExecuteNonQuery "0": " ".
.