Oracle自动生成数据字典的SQL语句

前端之家收集整理的这篇文章主要介绍了Oracle自动生成数据字典的SQL语句前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
select col.COLUMN_NAME,com.Comments,col.DATA_TYPE,col.DATA_LENGTH
from sys.all_tab_columns col,sys.all_col_comments com
where col.owner = '用户名'
and col.table_name = '表名'
and com.Owner (+) = '用户名'
and com.Table_Name (+) = '表名'
and com.Column_Name (+) = col.Column_Name
order by col.column_id

SELECT A.table_name,A.COLUMN_NAME,A.DATA_TYPE,a.DATA_LENGTH,a.DATA_PRECISION,a.DATA_SCALE,a.NULLABLE,a.DATA_DEFAULT,B.comments 
FROM all_tab_columns A,DBA_COL_COMMENTS B 
WHERE A.owner=B.owner 
AND A.table_name=B.table_name 
AND A.COLUMN_NAME=B.COLUMN_NAME 
AND A.owner='用户名'
ORDER BY A.table_name;
原文链接:https://www.f2er.com/oracle/207626.html

猜你在找的Oracle相关文章