/****************************************************************************/
/* SYSTEM_ID : GE                                                           */
/* DATA_DEFAULT ( FUNCTION )                                                */
/* Created : 2014/12/13 13:30:48                                            */
/****************************************************************************/
CREATE FUNCTION DATA_DEFAULT 
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;
/
