--------------------------------------------------------
--  DDL for Function SCHEDULE_NEXT_DATE
--------------------------------------------------------

  CREATE OR REPLACE EDITIONABLE FUNCTION "ENVX_OPER"."SCHEDULE_NEXT_DATE" (
	pi_job_name IN VARCHAR2
) RETURN TIMESTAMP AS

	v_next_run_date     TIMESTAMP;
	v_intervalo_repeticion   VARCHAR2(1000);


BEGIN


   SELECT next_run_date
   INTO v_next_run_date
   FROM user_scheduler_jobs  aj
   WHERE aj.job_name = pi_job_name;

	RETURN v_next_run_date;

EXCEPTION
	WHEN OTHERS THEN
		v_next_run_date := null;
		RETURN v_next_run_date;
END;


/
