转换一个Ora的自定义函数到SQL[在线等]
兴导 2005-11-03 10:53:54 ORA的函数为:
CREATE OR REPLACE FUNCTION "CARGO"."GETALLLOCATION" (p_id in
number) return varchar2 is
Result varchar2(100);
cursor rad_cursor(v_id varchar2) is
select Location from tbl_location where whid=v_id ;
v_count Number;
begin
v_count:=0;
for v_sor in rad_cursor(p_id) loop
if v_count=0 then
Result:=v_sor.Location;
v_count:=v_count+1;
else
Result:=Result||','||v_sor.Location;
end if;
end loop;
return(Result);
end getallLocation;
实际上很简单的一个函数,但因为小弟们都不在,我只好自己来啃技术,可惜又没时间深入研究,
所以只好请兄弟门帮忙解决一下了,多谢多谢