日期:2014-05-17 浏览次数:21101 次
--主键 select column_name from user_ind_columns where INDEX_NAME in(select INDEX_NAME from user_indexes where uniqueness = 'UNIQUE') and table_name = 'aaa' --外键 select column_name from user_ind_columns where INDEX_NAME in (select INDEX_NAME from user_indexes where uniqueness = 'UNIQUE') and table_name <> 'aaa' and colunm_name in(select column_name user_col_comments where table_name='aaa')
------解决方案--------------------
dbms_metadata
得到建表语句
select dbms_metadata.get_ddl('TABLE', 'EMP', 'SCOTT') from dual;
------解决方案--------------------
支持楼上的说法。