<?xml version='1.0' encoding='UTF-8'?>
<ROWSET tableName='xxx'>
/****************************************************************************/
/* SYSTEM_ID : GF                                                           */
/* INDEX_BIKO ( FUNCTION )                                                  */
/* Created : 2015/11/16 16:20:04                                            */
/****************************************************************************/
<EXEC_SQL>
CREATE     
function INDEX_BIKO(
	XSYSTEM_ID   in varchar2 ,
	XTBLSYU      in varchar2 ,
	XTABLE_NAME  in varchar2 ,
	XINDEX_NAME  in varchar2  )
return varchar2
is
    rtn     varchar2(2000);

	CURSOR codeC1 IS SELECT CLM
					FROM	GF07
					WHERE	SYSTEM_ID   = XSYSTEM_ID
					AND		TBLSYU      = XTBLSYU
					AND		TABLE_NAME  = XTABLE_NAME
					AND		INDEX_NAME  = XINDEX_NAME
					AND		FGJ			= &apos;1&apos;
					ORDER BY SEQNO;

	codeRec codeC1%ROWTYPE;

begin
	rtn := &apos;&apos; ;

	OPEN	codeC1;

	LOOP
		FETCH codeC1 INTO codeRec;
		EXIT WHEN codeC1%NOTFOUND;

		rtn := rtn || codeRec.CLM || &apos;,&apos; ;

	END LOOP;
	CLOSE codeC1;

	rtn := substr( rtn,1,lengthb(rtn)-1 );

	return rtn;

end INDEX_BIKO;

</EXEC_SQL>
</ROWSET>
