At 8:03 PM +0200 9/17/01, Danny Kohn wrote:
>Hi.
>Newbee trying to learn MySQL.
>
>On page 167 in the manual there is an example file that should be
>loaded into the newly created file event.
>
>The table is:
>+--------+--------------+------+-----+---------+-------+
>| Field | Type | Null | Key | Default | Extra |
>+--------+--------------+------+-----+---------+-------+
>| name | varchar(20) | YES | | NULL | |
>| date | date | YES | | NULL | |
>| type | varchar(15) | YES | | NULL | |
>| remark | varchar(255) | YES | | NULL | |
>+--------+--------------+------+-----+---------+-------+
>
>The file to import is:
>Fluffy 1995-05-15 litter 4 kittens, 3 female, 1 male
>Buffy 1993-06-23 litter 5 puppies, 2 female, 3 male
>Buffy 1994-06-19 litter 3 puppies, 3 female
>Chirpy 1999-03-21 vet needed beak straightened
>Slim 1997-08-03 vet broken rib
>Bowser 1991-10-12 kennel \N
>Fang 1991-10-12 kennel \N
>Fang 1998-08-28 birthday Gave him a new chew toy
>Claws 1998-03-17 birthday Gave him a new flea collar
>Whistler 1998-12-09 birthday First birthday
>
>The command to import is
>
>LOAD DATA LOCAL INFILE "d:/Program/MySQL/data/menagerie/event.txt"
>INTO TABLE event;
>
>But select * from event; gives the following very strange result:
>+----------+------------+----------+------------------------------+
>| name | date | type | remark |
>+----------+------------+----------+------------------------------+
> |Fluffy | 1995-05-15 | litter | 4 kittens, 3 female, 1 male
> |Buffy | 1993-06-23 | litter | 5 puppies, 2 female, 3 male
> | | 1994-06-19 | litter | 3 puppies, 3 female
> |rpy | 1999-03-21 | vet | needed beak straightened
> |8-03 | vet | broken rib
> |nnel | N
> |nnel | N
> | | 1998-08-28 | birthday | Gave him a new chew toy
> |laws | 1998-03-17 | birthday | Gave him a new flea collar
>| Whistler | 1998-12-09 | birthday | First birthday |
>+----------+------------+----------+------------------------------+
>
>Anyone that can explain why this is happening?
Does the event.txt file have linefeeds for line endings, or something
else?
>
>Hälsningar / Regards (\_/) ))
>Danny Kohn Tel: +46 (0)708 140 300 =('.')=// Miau!
>Systematik Consulting AB ICQ: 1328817 ( ~~~ )/ Rrrrrui!
>http://www.systematik.se HAM: SM0NBJ `w---w´
>
--
Paul DuBois, paul@stripped