create or replace procedure test (table_name varchar2)
as
  type ref_cursor  is ref cursor;
  cursor_table     ref_cursor;
  tablename        varchar2(100);
begin
  tablename := table_name;
  open   cursor_table for select * from tablename;
  close  cursor_table;
end test;
/

解决方案 »

  1.   

    to ATCG(novel gene) 大哥
    你写的编译有错的
    我根据dinya2003大哥所教的将其修改为
    create  or  replace  procedure  test  (table_name  varchar2)  
    as  
       type  ref_cursor    is  ref  cursor;  
       cursor_table          ref_cursor;  
       tablename                varchar2(100);  
        ssql                varchar2(100); 
    begin  
       tablename  :=  table_name;  
       ssql:='select  *  from  '||tablename||''; 
       open      cursor_table  for  ssql; 
       close    cursor_table;  
    end  test; 
    才没出错
      

  2.   

    根据ATCG(novel gene) 大哥和dinya2003大哥所教的
    我的问题解决了,谢谢