Oracle抓取表结构的语句
2015-06-03 11:32
363 查看
oracle ---------------------------------------
SELECT case when t.COLUMN_ID=1 then t.table_name end table_name,
case when t.COLUMN_ID=1 then t2.comments end table_comments,
t.COLUMN_ID,t.colUMN_NAME,t1.comments,case when t3.COLUMN_NAME is not null then 'Y' else NULL end primary_key
,t.DATA_TYPE,t.DATA_LENGTH,t.DATA_PRECISION,t.data_scale,t.nullable
FROM User_Tab_Cols t, User_Col_Comments t1, User_Tab_Comments t2,user_cons_columns t3
WHERE t.table_name = t1.table_name
AND t.column_name = t1.column_name
and t.table_name=t2.table_name
and t.table_name=t3.table_name(+) and t.COLUMN_NAME=t3.COLUMN_NAME(+) and t3.position(+)>0
and t.TABLE_NAME='S_SALARY'
order by t.COLUMN_ID
SELECT case when t.COLUMN_ID=1 then t.table_name end table_name,
case when t.COLUMN_ID=1 then t2.comments end table_comments,
t.COLUMN_ID,t.colUMN_NAME,t1.comments,case when t3.COLUMN_NAME is not null then 'Y' else NULL end primary_key
,t.DATA_TYPE,t.DATA_LENGTH,t.DATA_PRECISION,t.data_scale,t.nullable
FROM User_Tab_Cols t, User_Col_Comments t1, User_Tab_Comments t2,user_cons_columns t3
WHERE t.table_name = t1.table_name
AND t.column_name = t1.column_name
and t.table_name=t2.table_name
and t.table_name=t3.table_name(+) and t.COLUMN_NAME=t3.COLUMN_NAME(+) and t3.position(+)>0
and t.TABLE_NAME='S_SALARY'
order by t.COLUMN_ID
相关文章推荐
- oracle 如何预估将要创建的索引的大小
- oracle错误代码大全(超详细)
- oracle 条件:1=1或1=0,动态添加条件
- oracle 删除表、数据
- java+oracle+web(第九天) java 基础课程(四) 多线程其他小知识 终止、守护、等待
- oracle hanganalyze工具的使用
- 如何限制oracle的trace files及alert file大小
- oracle模糊查询语句使用示例
- oracle存储过程、声明变量、for循环|转|
- Oracle学习(13):数据字典
- oracle单行函数
- oracle ORA-01747(系统保留关键字)user.table.column, table.column 或列说明无效 hibernate映射oracle保留关键字
- (转)oracle常用的数据字典
- Oracle命令行工具基本操作及SQL 命令
- OracleLinux-R7-U1-Server-x86_64下安装oracle-11.2.0.4.0_linux_x86和x86_64
- Oracle 存储过程
- oracle分页查询sql原理与语句
- Oracle数据字典常用sql
- powerDesigner生成的oracle 建表sql hibernate 无法映射
- ORACLE 透明加密(TDE)