On Fri, 1 Jun 2001, Toth Dalibor wrote:
> I really need to know this: I have a column defined as char(2), default
> 'no', not null.
> When I create new entry into the table, I skip entering value into mentioned
> column
> because I expect to be filled with the default value, that is 'no'. But that
> doesn't happen!
> Why?
What version are you using?
mysql> CREATE TABLE tmp (id INT, v CHAR(2) DEFAULT 'no' NOT NULL);
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO tmp (id) VALUES(1);
Query OK, 1 row affected (0.01 sec)
mysql> SELECT * FROM tmp;
+------+----+
| id | v |
+------+----+
| 1 | no |
+------+----+
1 row in set (0.00 sec)
mysql> SELECT VERSION();
+-------------+
| VERSION() |
+-------------+
| 3.23.37-log |
+-------------+
Andreas Karl Wittwer
Phone: +49-7052-92206
FAX: +49-7052-92208
Mobil: +49-172-542 541 4
---------------------------------------------------------------------
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