字段的信息记录在系统表:col中

解决方案 »

  1.   

    create or replace procedure curtest
     is
       at_str varchar(2000);
       str_tname varchar(2000);
       acl_str varchar(2000);
       cl_tname varchar(2000);
       type t_cur is ref cursor;
       at_cur t_cur;
       acl_cur t_cur;
    begin
       at_str:='select TABLE_NAME from user_tables';
       open at_cur for at_str;
           loop
               fetch at_cur into str_tname;
               acl_str:='select COLUMN_NAME from user_tab_cols where TABLE_NAME ='''||str_tname||'''';
               open acl_cur for acl_str;
                   loop
                       fetch acl_cur into cl_tname;
                       DBMS_output.Put_Line(cl_tname);               
                   exit when acl_cur%notfound;
                   end loop;
               close acl_cur;
           exit when at_cur%notfound;
           end loop;
       close at_cur;
    end curtest;good luck