oracle常用语句

 

1、添加外键

alter table THDBA.BUYING  
   drop constraint FK_BUYING_REFERENCE_USER_INF;  

alter table THDBA.BUYING  
   add constraint FK_BUYING_REFERENCE_USER_INF foreign key (CUST_ID)  
      references THDBA.USER_INFO (CUST_ID);  

如果表中有记录则不能成功

 

2、修改某字段为非空

 

 alter table tableName modify  columnName  not null
 

你可能感兴趣的:(oracle)