CREATE OR REPLACE FUNCTION fun_test1(x NUMBER,average NUMBER,mod_value
NUMBER )
RETURN varchar2
IS
counter number := 0;
temp number :=0;
mod_temp number:=mod_value;
sumResult varchar2(4000);
BEGIN
temp := average+1;
FOR counter IN 1 .. x --for循环和条件
LOOP
if mod_temp>0 then
sumResult := sumResult||' '||temp;
else
sumResult := sumResult||' '||average;
end if;
mod_temp :=mod_temp-1;
END LOOP;
RETURN sumResult;
END fun_test1;