/****************************************************************************/
/* SYSTEM_ID : GF                                                           */
/* DATA_DEFAULT ( FUNCTION )                                                */
/* Created : 2017/06/02 17:06:55                                            */
/****************************************************************************/
CREATE     
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 > 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;
/
