---4查询该用户下面所有表对应的数据字典 SELECT COL.TABLE_NAME, --COL.COLUMN_ID AS COLORDER, TT.COMMENTS, COL.COLUMN_NAME AS COLUMNNAME, CASE WHEN PKCOL.COLUMN_POSITION > 0 THEN '√' ELSE '' END AS ISPK, COL.DATA_TYPE AS TYPENAME, --DECODE(COL.DATA_TYPE, 'NUMBER', COL.DATA_PRECISION, COL.DATA_LENGTH) AS LENGTH, COL.DATA_LENGTH 占用字节数, COL.DATA_PRECISION AS PRECI, COL.DATA_SCALE AS SCALE, CASE WHEN COL.NULLABLE = 'Y' THEN '√' ELSE '' END AS CISNULL, -- '' AS ISIDENTITY, COL.DATA_DEFAULT AS DEFAULTVAL, CCOM.COMMENTS AS DETEXT /*, COL.NUM_DISTINCT AS NUM_DISTINCT*/ FROM USER_TAB_COLUMNS COL, USER_COL_COMMENTS CCOM, (SELECT AA.TABLE_NAME, AA.INDEX_NAME, AA.COLUMN_NAME, AA.COLUMN_POSITION FROM USER_IND_COLUMNS AA, USER_CONSTRAINTS BB WHERE BB.CONSTRAINT_TYPE = 'P' AND AA.TABLE_NAME = BB.TABLE_NAME AND AA.INDEX_NAME = BB.CONSTRAINT_NAME /*AND AA.TABLE_NAME IN ('AA')*/ ) PKCOL, USER_TAB_COMMENTS TT WHERE COL.TABLE_NAME = CCOM.TABLE_NAME AND COL.COLUMN_NAME = CCOM.COLUMN_NAME AND COL.TABLE_NAME = TT.TABLE_NAME(+) -- AND COL.TABLE_NAME = 'AA' AND COL.COLUMN_NAME = PKCOL.COLUMN_NAME(+) AND COL.TABLE_NAME = PKCOL.TABLE_NAME(+) ORDER BY COL.TABLE_NAME,col.column_id