首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

创建约束后,插入数据失败?该怎么解决

2012-02-10 
创建约束后,插入数据失败?代码如下:/**/

创建约束后,插入数据失败?
代码如下:
/*==============================================================*/
/*   DBMS   name:             MySQL   5.0                                                                         */
/*   Created   on:           2007-4-4   11:31:49                                                         */
/*==============================================================*/


drop   table   if   exists   acti_newclass;

/*==============================================================*/
/*   Table:   acti_newclass                                                                                   */
/*==============================================================*/
create   table   acti_newclass
(
      id                                       int   not   null   auto_increment,
      act_id                               int,
      title                                 varchar(50),
      num                                     int,
      primary   key   (id)
);

alter   table   acti_newclass   add   constraint   FK_Reference_1   foreign   key   (act_id)
            references   acti_newclass   (id)   on   delete   cascade;



[解决办法]
插入数据时有什么报错??
[解决办法]
你的插入语句给两个出来看看。

热点排行