修改table 的常用方法

 

修改table 的常用方法

添加列:  alter table test_headers add col_test number;

修改列:  alter table test_headers modify litem varchar2(40) not null;

刪除列:  alter table test_lines drop column col_test;

重命名:  alter table test_lines rename column col_test to col_test1;

添加主鍵: alter table test_hlines add constraint pk_test primary key(lineid);

添加外鍵: alter table test_lines add constraint fk_test foreign key (hid) reference test_headers(hid)

失效主鍵: alter table test_lines disable constraint pk_test;

失效外鍵: alter table test_lines disable constraint fk_test;

刪除主鍵: alter table test_lines drop constraint pk_test cascade;

刪除外鍵: alter table test_lines drop constraint fk_test

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章