oracle游标使用

来源:互联网 发布:天下三捏脸数据女 编辑:程序博客网 时间:2024/05/16 12:57

 create or replace function ErrorTypeRead return varchar2 is

Result varchar2(3000);
type cursor_type is ref cursor;
tempName varchar2(100);
  
cursor testCur is select enuitemname from enudetail where enutype='errorType' order by enuitemvalue;  
begin
  
open testCur;
loop
    fetch testCur into tempName;
    exit when testCur%notfound;  
    Result:=Result||tempName||'  ';
    end loop;
    return(Result);
    exception
    when others then
    dbms_output.put_line('error!');
end ErrorTypeRead;

原创粉丝点击