List:General Discussion« Previous MessageNext Message »
From:Remember14a Date:August 20 2004 10:16pm
Subject:Re: LOAD DATA INFILE
View as plain text  
Dear friend,

I tried the IGNORE option so that data is loaded from the file to table, 
still getting error pasted below. Any advice.
------------------------------------------------------------------------

mysql> use b
Database changed
mysql> describe chicago
    -> ;
+-------+--------------+------+-----+---------+-------+
| Field | Type         | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| id    | int(11)      |      | PRI | 0       |       |
| email | varchar(150) |      | PRI |         |       |
+-------+--------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> LOAD DATA INFILE IGNORE id
    -> 'chicago.txt' INTO TABLE
    -> b.chicago;
ERROR 1064: You have an error in your SQL syntax.  Check the manual that 
corresponds to your MySQL server ver
'chicago.txt' INTO TABLE
b.chicago' at line 1
mysql>
-----------------------------------------------------
This is how I had done it before
-----------------------------------------------------
mysql> use b
> Database changed
> mysql> LOAD DATA INFILE
>     -> 'chicago.txt' INTO TABLE
>     -> b.chicago;
> ERROR 1062: Duplicate entry '' for key 2
> mysql>
> 
------------------------------------------------------------------------------
> -----------------------
> +-------+--------------+------+-----+---------+----------------+
> | Field | Type         | Null | Key | Default | Extra          |
> +-------+--------------+------+-----+---------+----------------+
> | id    | int(11)      |      | PRI | NULL    | auto_increment |
> | email | varchar(150) |      | PRI |         |                |
> +-------+--------------+------+-----+---------+----------------+
> 2 rows in set (0.02 sec)

Thread
load data infileRemember14a20 Aug
RE: load data infileVictor Pendleton20 Aug
Re: LOAD DATA INFILERemember14a21 Aug