我正在尝试在名为Booklets
的表中插入一行,该表具有可为空的列BookletSubjectID
。插入失败,因为
'BookletSubjectID'不能为空
这是我的MySQL会话逐字复制的。我必须遗漏一些非常明显的东西,但看不到它。
mysql> desc Booklets;
+----------------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------+------+-----+---------+----------------+
| BookletID | int(11) | NO | PRI | NULL | auto_increment |
| MemberID | int(11) | NO | MUL | NULL | |
| Name | varchar(255) | YES | | NULL | |
| Description | varchar(1000) | YES | | NULL | |
| RelationshipTypeID | varchar(12) | YES | MUL | NULL | |
| RateTypeID | varchar(2) | YES | MUL | NULL | |
| PrivTypeID | varchar(2) | NO | MUL | NULL | |
| PhotoAlbumID | int(11) | YES | MUL | NULL | |
| VideoAlbumID | int(11) | YES | MUL | NULL | |
| BookletSubjectTypeID | varchar(2) | NO | MUL | NULL | |
| BookletSubjectID | int(11) | YES | MUL | NULL | |
| Deleted | tinyint(1) | NO | | 0 | |
| Credt | datetime | NO | | NULL | |
| Updt | datetime | YES | | NULL | |
+----------------------+---------------+------+-----+---------+----------------+
14 rows in set (0.00 sec)
mysql> INSERT Booklets (MemberID, Name, PrivTypeID, BookletSubjectTypeID, Deleted, Credt)
VALUES (546502, 'dddd','pu', 'no', 1, NOW());
ERROR 1048 (23000): Column 'BookletSubjectID' cannot be null
谢谢, 唐