代码如下createtableproduct(idint(10)notnulluniqueprimarykey,namevarchar(20)notnull,functionvarchar(50),companyvarchar(20)notnull,addressvarchar(50));createtableoperate(op...
代码如下
create table product (
id int(10) not null unique primary key,
name varchar(20) not null,
function varchar(50),
company varchar(20) not null,
address varchar(50)
);
create table operate(
op_id int(10) not null unique primary key auto_increment,
op_name varchar(20) not null,
op_time time not null
);
create trigger tproduct_bf_insert before insert on product for each row
insert into operate values('null','insert product','now()');
create trigger tproduct_af_update after update on product for each row
insert into operate values('null','update product','now()');
create trigger tproduct_af_del after delete on product for each row
insert into operate values('null','delete product','now()');
insert into product
values ('1','abc','专治感冒','上海abc制药','上海市分厂');
然后就错误,显示错误
incorrect integer value null for column op_id at row 1
展开