create or replace function test return varchar2 is Result varchar2(4000); strname VARCHAR2 (4000); cursor c1 is select t.server_type from it统计_机器 t; begin result:=''; open c1; LOOP FETCH c1 INTO strname; EXIT WHEN c1%NOTFOUND; result:=result||','||strname; END LOOP; close c1; return(Result); end test;
Result varchar2(4000);
strname VARCHAR2 (4000);
cursor c1 is select t.server_type from it统计_机器 t;
begin
result:='';
open c1;
LOOP
FETCH c1 INTO strname;
EXIT WHEN c1%NOTFOUND; result:=result||','||strname;
END LOOP;
close c1;
return(Result);
end test;