赞
踩
1、查询表信息
select * from user_constraints c where c.constraint_type = 'R' and c.table_name = 要查询的表;
说明:
constraint_type:表示约束类型,R表示外键,P表示主键
例如:
select * from user_constraints c where c.constraint_type = 'R' and c.table_name = upper('Log_Acesso_Funcao');
2、查询外键约束的列名
select * from user_cons_columns cl where cl.constraint_name = 外键名称;
说明:
constraint_name:表示约束名称
例如:
select * from user_cons_columns cl where cl.constraint_name = 'LOGACFU_TALOGAC_FK';
2.1、查询表结构
SELECT table_name, column_name, data_type,DATA_LENGTH,COLUMN_ID FROM USER_TAB_COLUMNS WHERE table_name =upper('b_notice');
SELECT * from user_tab_columns where table_name='B_NOTICE';
SELECT * FROM all_tab_cols WHERE table_name =upper('b_notice');
2.2、查看建表语句
select dbms_metadata.get_ddl('TABLE','B_NOTICE') from dual;
2.3、查看oracle单个数据表包含的索引
select * from user_indexes where table_name=upper('B_NOTICE');
2.4、查看哪些表哪些字段包含指定类型
SELECT table_name, column_name, data_type,DATA_LENGTH,COLUMN_ID FROM all_tab_cols WHERE data_type =upper('NVARCHAR2')
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。