open cursor for 
'select * ...'应该就可以了

解决方案 »

  1.   

    比如:declare 游标1 is select 字段1,字段2,字段3 from 表1 ;
        open 游标1 ;
        loop
          fatch 游标1 into :变量1,:变量2:,:变量3 ;
        end loop ;
        close 游标1
      

  2.   

    我在存储过程中用的,是这样写的:
    {strsql in varchar2;}
    type cur ref cursor;
    mycursor cur;
    crecord mycursor%rowtype;begin
         open mycursor for strsql;
          loop
              fetch  mycursor into crecord;
              dbms_output.put_line(crecord.name);
          end loop;end;
    老是出错,说主体不完整什么的,item ignore……
    怎么回事啊?
      

  3.   

    select 你需要的列fetch 时into到相应变量试试看