Strange problem when loading a table -- What did I do wrong?
Posted by:
Brian Gray
Date: February 26, 2005 08:38AM
I was hoping someone may be able to explain the following mysql results for me.
Created a table NO PROBLEM
mysql> desc students;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| STUDID | varchar(9) | | PRI | | |
| LNAME | varchar(30) | | | | |
| FNAME | varchar(30) | | | | |
| LEARNID | varchar(15) | YES | | NULL | |
| COMMENT | text | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
5 rows in set (0.00 sec)
Loaded data into the table from a text file. Took a few tries but seems ok.
mysql> load data infile 'C:\\INT120AW05.txt' into table brian.students
-> fields terminated by '+'
-> ;
Query OK, 34 rows affected, 34 warnings (0.02 sec)
Records: 34 Deleted: 0 Skipped: 0 Warnings: 34
BUT... When I check the data I get NULL for STUDID
mysql> select * from students;
+-----------+-------------+---------------------+-----------+---------+
| STUDID | LNAME | FNAME | LEARNID | COMMENT |
+-----------+-------------+---------------------+-----------+---------+
| NULL || Jeganathan | Sutharsanan | sjeganat
| NULL || Bouttchenko | Kirill | kbouttch
| NULL | Chan | Henry Ka Ho | hkchan4
| NULL || Graham | Kevin Douglas | kdgraham
| NULL || Thurairajah | Thirujan | tthurai3
| NULL |Scali | Roberto | rscali
| NULL || Hadjicosta | Elias | ehadjico
| NULL || Roberts | Junior | jrobert3
| NULL || Machado | Samantha Ann | samacha1
| NULL || Dennis | Rayon | rdennis1
| NULL || Mendonca | Michael Jeremy | mjmendon
| NULL | Skoric | Stevan | sskoric
| NULL || Untalasco | Jason Noble | jnuntala
| NULL || Singh | Vic | vsingh11
| NULL |eri | Muneesh | maeri
| NULL || Genesove | Avihayil Moshe | amgeneso
| NULL |Anjum | Umar | uanjum
| NULL || McDonald | Daryl Lennox | dlmcdon2
| NULL || Kenzaki | Thomas | tkenzaki
| NULL | Dhama | Andrew Justin | ajdhama
| NULL || Capiral | Nino Angelo ramos | nacapira
| NULL | Baker | James Christopher | jcbaker
| NULL |Fung | Geoffrey | gfung1
| NULL | Frail | Matthew Christopher | mcfrail
| NULL || Morton | Antwon Jevon | ajmorton
| NULL |u | Xuebin | xhu12
| NULL |Soylu | Atilla | asoylu
| NULL || Zheng | Yan | yzheng32
| NULL | Motovs | Stanislavs | smotovs
| NULL | Lee sui | Byron | bleesui
| NULL |Amini | Daud | damini
| NULL |i | Ricky | rli23
| NULL | Viola | Anthony Acacio | aaviola
| NULL || Hussain | Ayaz | ahussai7
+-----------+-------------+---------------------+-----------+---------+
34 rows in set (0.00 sec)
or do I?????
mysql> select studid from students;
+-----------+
| studid |
+-----------+
| 014216055 |
| 016338048 |
| 016870016 |
| 018546044 |
| 018793042 |
| 018998047 |
| 019720044 |
| 026330043 |
| 026613034 |
| 027324045 |
| 028972040 |
| 029802022 |
| 032100992 |
| 032828048 |
| 034118018 |
| 039693031 |
| 039881032 |
| 042232033 |
| 044132017 |
| 050446004 |
| 052166048 |
| 061456042 |
| 064523996 |
| 064552045 |
| 064695042 |
| 064851041 |
| 064960040 |
| 065276040 |
| 065320046 |
| 065526048 |
| 065926040 |
| 065943045 |
| 066074048 |
| 066099045 |
+-----------+
34 rows in set (0.00 sec)
or do I???
mysql> select studid, lname, fname, learnid from students;
+-----------+-------------+---------------------+-----------+
| studid | lname | fname | learnid |
+-----------+-------------+---------------------+-----------+
|014216055 | Jeganathan | Sutharsanan | sjeganat
|016338048 | Bouttchenko | Kirill | kbouttch
|16870016 | Chan | Henry Ka Ho | hkchan4
|018546044 | Graham | Kevin Douglas | kdgraham
|018793042 | Thurairajah | Thirujan | tthurai3
|8998047 | Scali | Roberto | rscali
|019720044 | Hadjicosta | Elias | ehadjico
|026330043 | Roberts | Junior | jrobert3
|026613034 | Machado | Samantha Ann | samacha1
|027324045 | Dennis | Rayon | rdennis1
|028972040 | Mendonca | Michael Jeremy | mjmendon
|29802022 | Skoric | Stevan | sskoric
|032100992 | Untalasco | Jason Noble | jnuntala
|032828048 | Singh | Vic | vsingh11
|118018 | Aeri | Muneesh | maeri
|039693031 | Genesove | Avihayil Moshe | amgeneso
|9881032 | Anjum | Umar | uanjum
|042232033 | McDonald | Daryl Lennox | dlmcdon2
|044132017 | Kenzaki | Thomas | tkenzaki
|50446004 | Dhama | Andrew Justin | ajdhama
|052166048 | Capiral | Nino Angelo ramos | nacapira
|61456042 | Baker | James Christopher | jcbaker
|4523996 | Fung | Geoffrey | gfung1
|64552045 | Frail | Matthew Christopher | mcfrail
|064695042 | Morton | Antwon Jevon | ajmorton
|851041 | Hu | Xuebin | xhu12
|4960040 | Soylu | Atilla | asoylu
|065276040 | Zheng | Yan | yzheng32
|65320046 | Motovs | Stanislavs | smotovs
|65526048 | Lee sui | Byron | bleesui
|5926040 | Amini | Daud | damini
|943045 | Li | Ricky | rli23
|66074048 | Viola | Anthony Acacio | aaviola
|066099045 | Hussain | Ayaz | ahussai7
+-----------+-------------+---------------------+-----------+
34 rows in set (0.00 sec)
I don't understand why I would get 3 different results for the same field.
Have you seen anything like this before??
Brian
Subject
Written By
Posted
Strange problem when loading a table -- What did I do wrong?
February 26, 2005 08:38AM
February 26, 2005 01:39PM
February 26, 2005 03:51PM
February 26, 2005 04:02PM
February 26, 2005 11:59PM
February 27, 2005 02:23AM
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.