why won't this insert work?
Sorry for such a dumb question but I'm a newbie and the answer isn't
obvious to me.
I've got a table with the following definition:
mysql> show columns from participant;
+----------------+-------------+------+-----+---------+----------------
+
| Field | Type | Null | Key | Default | Extra
|
+----------------+-------------+------+-----+---------+----------------
+
| part_id | int(5) | NO | PRI | NULL | auto_increment
|
| surname | varchar(50) | YES | | NULL |
|
| firstname | varchar(50) | YES | | NULL |
|
| street_address | varchar(50) | YES | | NULL |
|
| city | varchar(50) | YES | | NULL |
|
| state | varchar(20) | YES | | NULL |
|
| zipcode | varchar(10) | YES | | NULL |
|
| country_id | int(4) | YES | | NULL |
|
| phone | varchar(15) | YES | | NULL |
|
+----------------+-------------+------+-----+---------+----------------
+
I don't understand why the following INSERT doesn't work.
mysql> INSERT INTO participant VALUES ('Washington','George','a
farm','Mount Vernon','VA','00001',NULL,'000-000-0000');
ERROR 1136 (21S01): Column count doesn't match value count at row 1
There are 8 non-auto_increment fields and 8 values in the UPDATE
statement.
Any thoughts would be greatly appreciated!!
TIA,
David
Subject
Written By
Posted
why won't this insert work?
February 23, 2009 09:34PM
February 23, 2009 09:44PM
February 23, 2009 11:52PM
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.