create table primarytable
(
A NUMBER not null,
B VARCHAR2(30) ,
)
alter table primarytable
add constraint FK_NAME foreign key (B)
references foreignTalbe (B);
(
A NUMBER not null,
B VARCHAR2(30) ,
)
alter table primarytable
add constraint FK_NAME foreign key (B)
references foreignTalbe (B);
注意标点符号:
create table primarytable
(
A NUMBER not null,
B VARCHAR2(30)
);
alter table primarytable
add constraint FK_NAME foreign key (B)
references foreignTalbe (B);
pk NUMBER PRIMARY KEY,
fk NUMBER,
c1 NUMBER,
c2 NUMBER,
CONSTRAINT ri FOREIGN KEY (fk) REFERENCES t1,
CONSTRAINT ck1 CHECK (pk > 0 and c1 > 0),
CONSTRAINT ck2 CHECK (c2 > 0)
);
ANUMBER(9) not null,
JSJ CHAR(8) not null,
XJZ CHAR(8) not null,
ZDXH NUMBER(9) not null,
DDRQ DATE not null,
BJBZ CHAR not null,
constraint CCKLDB_PK1 primary key (LDXH)
using index
pctfree 1
tablespace yz_flow2_inx
)
A NUMBER(9) not null,
B CHAR(8) not null,
C CHAR(8) not null,
constraint TABLENAME_PK1 primary key (A)
using index
);