<?xml version='1.0' encoding='UTF-8'?>
<ROWSET tableName='xxx'>
<EXEC_SQL>
CREATE OR REPLACE FUNCTION DATA_DEFAULT(
	VAL IN VARCHAR2  )
RETURN VARCHAR2
IS
    RETVAL     VARCHAR2(30);
	IDX        NUMBER ;
BEGIN
	RETVAL := NULL ;
	IF VAL IS NOT NULL THEN
		IDX := INSTRB(VAL,'/*');
		IF IDX &gt; 0 THEN
			RETVAL := LTRIM(RTRIM(SUBSTRB(REPLACE( VAL,'''',' ' ),1,IDX-1)));
		ELSE
			RETVAL := LTRIM(RTRIM(SUBSTRB(REPLACE( VAL,'''',' ' ),1,30)));
		END IF;
	END IF;

	RETURN RETVAL;
END DATA_DEFAULT;
</EXEC_SQL>
</ROWSET>
