如何查看主鍵名稱?
想要查看主鍵名稱要通過查詢ORACLE的數(shù)據(jù)字典才能知道。
1、查主鍵名稱: select * from user_constraints where table_name = 'ART' and constraint_type ='P'; 查主鍵對應的列: select * from user_cons_columns where table_name = 'ART' and constraint_name = 'PK_ART';
2、查索引名稱: select * from user_indexes where table_name = 'ART'; 查索引對應的列: select * from user_ind_columns where table_name = 'ART' and index_name = 'INDX_BA';