> You are inserting 6 values into 7 fields, so it fails.
looks like a 6 field table to me
create table if not exists MSFT (date DATE not null, close
DECIMAL(10,2), high DECIMAL(10,2), low DECIMAL(10,2), volume MEDIUMINT,
yest DECIMAL(10,2), PRIMARY KEY date (date));
1) date
2) close
3) high
4) low
5) volume
6) yest
7) PRIMARY KEY -- Not a field, unless they REALLY changed things in MySQL 4
> You are also inserting numbers with 4 digits right of the decimal, where
> you have specified 2.
inserting numbers that are too big just get trimmed, again unless its another
MySQL 4 change.
running the script on MySQL 3 get the expected results.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 34 to server version: 3.23.49-log
mysql> create table if not exists MSFT (date DATE not null, close
DECIMAL(10,2), high DECIMAL(10,2), low DECIMAL(10,2), -> volume
MEDIUMINT, yest DECIMAL(10,2), PRIMARY KEY date (date));
Query OK, 0 rows affected (0.10 sec)
mysql> delete from MSFT where date='2003-02-04';
Query OK, 0 rows affected (0.04 sec)
mysql> insert ignore into MSFT
Values('2003-02-04','47.3200','47.9400','46.8800','406440','47.8000');
Query OK, 1 row affected (0.06 sec)
mysql> select * from MSFT;
+------------+-------+-------+-------+--------+-------+
| date | close | high | low | volume | yest |
+------------+-------+-------+-------+--------+-------+
| 2003-02-04 | 47.32 | 47.94 | 46.88 | 406440 | 47.80 |
+------------+-------+-------+-------+--------+-------+
1 row in set (0.02 sec)
--
mysql, sql, query, sql, sql, sql
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php