create table Action_type
(
Id number(12) not null primary key,
Name varchar2(100) not null
)
create table Action_info
(
Id number(12) not null primary key,
Action_type_id number(12) constraint FK_Action_info foreign key references Action_type(Id)
)这是我创建的两个表,其中Action_info中的Action_type_id字段是Action_type的外键,但是我创建的时候出现了错误:ORA-02253:constraint specification not allowed here 这是什么原因?应该怎么写?
(
Id number(12) not null primary key,
Name varchar2(100) not null
)
create table Action_info
(
Id number(12) not null primary key,
Action_type_id number(12) constraint FK_Action_info foreign key references Action_type(Id)
)这是我创建的两个表,其中Action_info中的Action_type_id字段是Action_type的外键,但是我创建的时候出现了错误:ORA-02253:constraint specification not allowed here 这是什么原因?应该怎么写?
id number,addr varchar2(20),
t_id number,
constraint c_fk foreign key(t_id) references t(id))