create function GetData (
v_ID number
)
return v_str varchar2(4000) ;
v_content varchar2(4000) := '';
CURSOR c_DataContent IS
select str_value from test where id = v_ID;
begin
OPEN c_DataContent;
LOOP
FETCH c_DataContent INTO v_content;
v_str := v_str || v_content;
EXIT WHEN c_DataContent%NOTFOUND;
END LOOP;
close c_DataContent;
return v_str;
end;
v_ID number
)
return v_str varchar2(4000) ;
v_content varchar2(4000) := '';
CURSOR c_DataContent IS
select str_value from test where id = v_ID;
begin
OPEN c_DataContent;
LOOP
FETCH c_DataContent INTO v_content;
v_str := v_str || v_content;
EXIT WHEN c_DataContent%NOTFOUND;
END LOOP;
close c_DataContent;
return v_str;
end;
return varchar2
is
v_str varchar2(4000) := '';
CURSOR c_DataContent(p_id number) IS
select str_value from test where id =p_id;
begin
for v_sor in c_DataContent(v_id) loop
v_str = v_str || v_sor.str_value;
END LOOP;
return v_str;
end;
/
FETCH c_DataContent INTO v_content;
v_str = v_str || v_content;
EXIT WHEN c_DataContent%NOTFOUND;
END LOOP;改为
LOOP
FETCH c_DataContent INTO v_content;
EXIT WHEN c_DataContent%NOTFOUND;
v_str := v_str || v_content;
END LOOP;顺序有问题,还有就是少了个: