Create function get_file_fieldlist(
Template_NO_in in number
) return varchar2 is
Type fieldlist is table of varchar2
Index by binary interger;
Field_Names fieldlist;
V_STR VARCHAR2(30) ;
V_result varchar2(2000) ;
Begin
Select 'Information_'||field_no||' as '||column_name ||', '
bulk collect into Field_Names
Where upper(effective_flg)='Y' and Template_NO=Template_NO_in;
V_STR =FIELD_NAMES(FIELD_NAMES.LAST);
FIELD_NAMES(FIELD_NAMES.LAST)=SUBSTR(V_STR,1,LENGTH(V_STR)-1);
For I IN 1 ..FIELD_NAMES.COUNT LOOP
Vl_result :=VL_RESULT||FIELD_NAMES(I);
END LOOP;
RETURN V_RESULT;
end