load data infile '#loadpath##loadfile#' replace into table #sourcetable# fields terminated by '|' Lines terminated by '\r ' ignore 1 lines; </cfquery> From what I read all infile fields are processed as strings. This creates a warning when a field value is going into an integer, date etc.
2) Either use Proc Import code or the SAS file data import wizard for a CSV delimited file. 3) Look in the log. There should be program with an infile statement describing the options used, Informat and Format statements, an Input statement and two lines related to checking if you have critical errors.
私はCSVファイルからMysqlに20000行のデータをインポートしています。 CSVの列は、MySQLテーブルの列とは異なる順序です。 MySQLのテーブルの列に対応する列を自動的に割り当てる方法は? 私が実行すると . LOAD DATA INFILE'abc.csv' INTO TABLE abc
mysql > CREATE DATABASE menagerie; mysql > USE menagerie Database changed 2. Creating a Table. Use a CREATE TABLE statement to specify the layout of your table: mysql > CREATE TABLE pet (name VARCHAR (20), owner VARCHAR (20), species VARCHAR (20), sex CHAR (1), birth DATE, death DATE); Once you have created a table, SHOW TABLES should produce ...
Теперь IMHO вам нужно преобразовать немало полей, пока вы их загружаете: если date в вашей таблице имеет datetime данных datetime тогда ее необходимо преобразовать, иначе вы получите сообщение об ошибке
load data infile '#loadpath##loadfile#' replace into table #sourcetable# fields terminated by '|' Lines terminated by '\r ' ignore 1 lines; </cfquery> From what I read all infile fields are processed as strings. This creates a warning when a field value is going into an integer, date etc.
LOAD DATA INFILE d'un CSV, bug 1ere ligne × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié. × Attention, ce sujet est très ancien.
It's because MySQL is actually trying to insert the literal string 'NULL' into a DATE column, not the actual value NULL. Your choices are: Global search for |NULL| in your file and replace with || Change your LOAD DATA statement to deal with it:
load data infile 'name.csv' into table table1 fields terminated by ',' lines terminated by ' ' ignore 1 lines ??? la question est, que dois-je mettre sur ??? afin que je puisse stocker des données comme ceci: