日期:2014-05-16  浏览次数:20699 次

创建约束后,插入数据失败?
代码如下:
/*==============================================================*/
/*   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;



------解决方案--------------------
插入数据时有什么报错??
------解决方案--------------------
你的插入语句给两个出来看看。