用DBMS_SQL动态执行SQL语句,参考:
http://expert.csdn.net/Expert/TopicView1.asp?id=1442816

解决方案 »

  1.   

    ...
     cursor c is select ....;
     ...
    begin
     open c;
     fetch c into ...;
     while c%found loop
       ...
       fetch c into ...;
      end loop;
     ...
      

  2.   

    可能要使用到游标变量,静态游标不能实现。create procedure name_pro(p_table in varchar2)
    as
    type t_sor is ref cursor;
    v_sor t_sor;
    str varchar2(50);
    begin
    str:='select * from cat where table_name='||upper(p_table);
    open v_sor for str;
    end;
    /