Create VIEW Temp_view as
(Select B.column_name,a.table_name,b.column_id,b.data_type
From User_tables A,user_tab_columns b where a.table_name=b.table_name);
------------------------------------------
SELECT * from Temp_view order by table_name,column_id;
------------------------------------------
Spool Create_table.sql;
Select TT from
(SELECT ' CREATE TABLE ' tt,table_name,0.1 column_id from User_tables u
UNION ALL
Select Table_name| | ' (', table_name,0.2 column_id from User_tables u
UNION ALL
Select Column_name| | ' ' | | data_type| | ', ', t.table_name,column_id from User_tables U,temp_view t where u.table_name=t.table_name
UNION ALL
Select '), ', table_name,999 column_id from user_tables u) temp
--where table_name<> ' temp_table '
Order BY table_name,column_id;
Spool off;
sql> @create_table. sql
This article is from the DBA Sky blog, so be sure to keep this source http://joeyzhang.blog.51cto.com/7594056/1671846
Table structure Export method for database users