-- B1 DEPENDS: AFTER:PT:PROCESS_END AFTER:SP:CFF_CREATEDBOBJECTS

CREATE PROCEDURE CFF_GETLONGESTHOLIDAY 
LANGUAGE SQLSCRIPT 
SQL SECURITY INVOKER
AS
BEGIN
	INSERT INTO CFF_TMP_HOLIDAY
	SELECT T1."HldCode", MAX(DAYS_BETWEEN(T1."StrDate", T1."EndDate") + 3) FROM HLD1 T1 GROUP BY T1."HldCode";
END;