例如:
--1.0  clear redundancy row in interface table
  BEGIN
  FOR v_redundancy IN
    (
        select mm.* from
         (
             select xx.* from tblUnitOfMeasureintf xx,
                 (select * from (select fid, count(*) as aa
                                 from tblUnitOfMeasureintf
                                 group by fid) where aa>1
                  )  yy
             where xx.fid=yy.fid  
         ) mm
    )  -- this cursor var can select all redundancy row 
  LOOP
  delete from tblUnitOfMeasureintf a
           where a.rowid != (
                             select max(rowid) from tblUnitOfMeasureintf b
                             where b.fid=a.fid   
                            )
           and a.fid=v_redundancy.fid 
           ;
  --use rowid del redunancy row by PK
  END LOOP;
  COMMIT;
  --1.0 end
以上是一个用游标的例子.

解决方案 »

  1.   

    输出的游标
    在CREATE OR REPLACE PROCEDURE   REPFFORBLEAVPRC
    ( CurrentPage in number, PageSize in number, TotalRecords OUT number,..) 
    as 
    begin
    ..
    end;
    在这里怎么声明,
    在bengin
      ...
    end
    里面怎么实现我声明为在CREATE OR REPLACE PROCEDURE   REPFFORBLEAVPRC
    (cur1 OUT Cursor)
    怎么报措说Cursor找不到什么的
      

  2.   

    在package中type returnCur is ref cursor;
    在body中
     procedure GetAllReadyProjectInfo(ret out returnCur)
     --获得所有准备中的项目
     as
     LocalCursor returnCur;
     begin
        open LocalCursor for
          select Project_ID
          from project
          where project_isdeleted=0;
        ret:=LocalCursor;
     end GetAllReadyProjectInfo;
      

  3.   

    programmeraaron(冷侠)
    经常用次发放返回游标,会发生下列错误
    ORA-01000: 超出打开游标的最大数 ORA-06512: 在"EIPCONNECT.PKG_MODULE", line 171 ORA-06512: 在line 1 请问如何解决
      

  4.   

    Cursor c1 is Select name,cSex,BirthDay,enddate,ForbType,ForbUnit from tmpfforbleavtbl where id>FirstRec and id<LastRec;
    open c1;
     fetch  c1  into   var1,……;
    while c1%found  loop
                   ......
                   fetch c1 into  var1,……;
    end loop;
    close c1;