oracle 更改表结构 ---- 添加

SQL> alter table dmias_dm_model_para_inf
  2  add (para_name varchar2(64));
 
Table altered
 
SQL>

 

2.捡主键

ALTER TABLE dmias_dm_models_inf1
ADD CONSTRAINT pk_dmias_dm_models_inf1 PRIMARY KEY (PK_THEME_ID);

 

3.

 

create table DMIAS_DM_MODEL_DATASOURCE_INF1
(
  PK_DATASOURCE_ID        VARCHAR2(64) not NULL  PRIMARY KEY,
  FK_THEMEM_ID            VARCHAR2(64) ,
  FK_MODEL_ID             VARCHAR2(64) ,
  DATASOURCE_NAME         VARCHAR2(1000),
  DATASOURCE_ID           VARCHAR2(64),
  DATA_TYPE_NAME          VARCHAR2(2),
  DATA_TYPE_ID            VARCHAR2(2),
  DELEGATED_MEDICINE_NAME VARCHAR2(1000),
  DELEGATED_MEDICINE_ID   VARCHAR2(64),
  CONSTRAINT FK_THEMEM_ID FOREIGN KEY (FK_THEMEM_ID) REFERENCES Dmias_Dm_Models_Inf1(PK_THEME_ID)
)

你可能感兴趣的:(oracle,sql)