oracle库如何根据表名得到这个表的所有字段名称,及字段类型,是否为空等。
其主要目的是根据已经存在的表来生成一个与原有表除了表名不一样,其他都一样的表。

解决方案 »

  1.   

    create table new_table_name
    as
    select * from old_table_name
    where 1=2;
      

  2.   

    create table new_table_name
    as
    select * from old_table_name
    where 1=2;
    ------------------------------------------
    你说的这种方法是可以创建表,但新建立的表主键并没有啊?
      

  3.   

    查sys下的一个叫什么的视图(-_-|| 名字忘了),里面记载了所有表的结构信息