查看錶結構:sql
看字段名與數據類型 工具
SELECT * FROM COLS WHERE TABLE_NAME = UPPER('TABLE_NAME');
查看主鍵:
code
SELECT * FROM USER_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'P' AND TABLE_NAME=UPPER( 'TABLE_NAME');
另外:table
在SQLPLUS中,用 desc tablename
在PL/SQL工具中,能夠經過視圖user_tab_columns 查看 class
SELECT * FROM USER_TAB_COLUMNS WHERE TABLE_NAME = UPPER('TABLE_NAME');
查看備註:數據類型
--查看錶的comment SELECT * FROM ALL_TAB_COMMENTS WHERE TABLE_NAME = UPPER('TABLE_NAME'); --查看列的comment SELECT * FROM ALL_COL_COMMENTS WHERE TABLE_NAME = UPPER('TABLE_NAME');