create table YS_MZ_BLXD02
(
XMBH numeric(18) not null,
XDBH numeric(9),
XMBM varchar(40) not null,
XMMC varchar(100) not null,
XMNR varchar(255) not null,
constraint PK_YS_MZ_BLXD02 primary key (XMBH)
);create index IX_YS_MZ_BLXD02 on YS_MZ_BLXD02 (
XDBH ASC
);alter table YS_MZ_BLXD02
add constraint FK_YS_MZ_BL_REFERENCE_YS_MZ_BL foreign key (XDBH)
references YS_MZ_BLXD01 (XDBH)
on update restrict
on delete restrict;strict
SQL提示:在关键字 'restrict' 附近有语法错误。
(
XMBH numeric(18) not null,
XDBH numeric(9),
XMBM varchar(40) not null,
XMMC varchar(100) not null,
XMNR varchar(255) not null,
constraint PK_YS_MZ_BLXD02 primary key (XMBH)
);create index IX_YS_MZ_BLXD02 on YS_MZ_BLXD02 (
XDBH ASC
);alter table YS_MZ_BLXD02
add constraint FK_YS_MZ_BL_REFERENCE_YS_MZ_BL foreign key (XDBH)
references YS_MZ_BLXD01 (XDBH)
on update restrict
on delete restrict;strict
SQL提示:在关键字 'restrict' 附近有语法错误。
这个之间是逗号吧。还是用界面编辑比较保险。
ALTER TABLE table_name
ADD
< table_constraint > ::=
[ CONSTRAINT constraint_name ]
| FOREIGN KEY
( column [ ,...n ] )
REFERENCES ref_table [ (ref_column [ ,...n ] ) ]
[ ON DELETE { CASCADE | NO ACTION | SET DEFAULT |SET NULL } ]
[ ON UPDATE { CASCADE | NO ACTION | SET DEFAULT |SET NULL } ]
[ ON UPDATE { CASCADE | NO ACTION | SET DEFAULT |SET NULL } ]
学习。restrict 是在mysql中的吧。同no action.