create or replace function get_ope_popedom(sta_id varchar2) return varchar2
? /*
?? * NAME:
?? *?? get_ope_popedom
?? *
?? * PARAMETER:
?? *?? sta_id???- 車站編號,多個站時以逗號分隔
?? *
?? * RETURN:
?? *?? --對應車站編號的車站名稱,多個站時以逗號分隔
?? *
?? * AUTHOR:
?? *???舵手
?? *
?? * DESCRIPTION:
?? *?? --根據傳入的車站編號返回相應的車站名稱
?? *
?? */
as
Result varchar2(1000);
name_temp varchar2(40);
type?cursor_t is ref cursor;
emp_cur cursor_t ;
begin
? OPEN emp_cur FOR 'SELECT sta_name FROM station_code where sta_code =:1'
? using sta_id;
? LOOP
????? FETCH emp_cur INTO name_temp;
????? If (emp_cur%NOTFOUND) Then
???????? EXIT;
????? End if;
????? Result := Result || name_temp || ',';
? end loop;
? close emp_cur;
? Result := substr(Result,1,(length(Result)-1));
? return(Result);
end get_ope_popedom;