试试这样行不行:
create or replace procedure DotNetPagination()
is
  
  type t_cursor is ref cursor; 
  v_cur t_cursor;
  Cstr varchar2(1000);
begin  
  Cstr := 'select * from cd_dwdm';
  OPEN v_cur FOR Cstr ;end;
将 type t_cursor is ref cursor;  放在包头里,或是个全局变量

解决方案 »

  1.   

    执行DDL:
    create or replace procedure dsql1
    is
    begin
      execute immediate 'create table test(name char(2))';
      dbms_output.put_line('successful !');
    exception
      when others then
      dbms_output.put_line('error !!!');
    end;
      

  2.   

    to: qiaozhiwei(乔) 
    试了一下,不行
      

  3.   

    create or replace procedure DotNetPagination()
    is
      type t_cursor is ref cursor;
      v_cur t_cursor;
      Cstr varchar2(1000);
    begin    
    open v_cur for 'select * from cd_dwdm';
    然后你可以对游标v_cur操作了
    end;
      

  4.   

    create or replace procedure DotNetPagination()
    is
      type t_cursor is ref cursor;
      v_cur t_cursor;
      Cstr varchar2(1000);
    begin    
      Cstr := ' select * from cd_dwdm';  execute immediate Cstr; 
      OPEN v_cur For cstr;   
    .
    .
    .       end;
      

  5.   

    create or replace procedure DotNetPagination()
    is
      type t_cursor is ref cursor;
      v_cur t_cursor;
      Cstr varchar2(1000);
    begin    
      Cstr := ' select * from cd_dwdm';  execute immediate Cstr; 
      OPEN v_cur For cstr;      end DotNetPagination;
      

  6.   

    不好意思,多了对括号^_^
    create or replace procedure DotNetPagination
    is
      type t_cursor is ref cursor;
      v_cur t_cursor;
      Cstr varchar2(1000);
    begin    
      Cstr := ' select * from cd_dwdm';  execute immediate Cstr; 
      OPEN v_cur For cstr;      end DotNetPagination;
      

  7.   

    'OPEN v_cur FOR select * from cd_dwdm'这是sql的语法吧,oracle用is不用for
      

  8.   

    ok,liuyi8903(juventus) 说的正确的