
USE parts;

DROP PROCEDURE IF EXISTS parts.p_dog_clear_calc_weather;
DROP PROCEDURE IF EXISTS parts.p_weather_clear_calc_weather;

DELIMITER //
CREATE PROCEDURE parts.p_dog_clear_calc_weather (
	  IN a_guid BINARY(36)
    , IN a_debug BIT
)
BEGIN
	DECLARE v_time_start TIMESTAMP(6);
    SET v_time_start := CURRENT_TIMESTAMP(6);
    
    CALL parts.p_core_validate_guid ( a_guid );
    
	START TRANSACTION;
		
		DELETE WEATHERS_T
        FROM parts.DOG_Weather_Temp WEATHERS_T
		WHERE WEATHERS_T.GUID = a_guid
		;
		
	COMMIT;
    
    IF a_debug = 1 THEN
		CALL parts.p_debug_timing_reporting( v_time_start );
    END IF;
END //
DELIMITER ;

/*

CALL parts.p_dog_clear_calc_weather (
	'crips                               ' -- a_guid
    , 1 -- debug
);

SELECT *
FROM parts.DOG_Calc_User_Temp
WHERE GUID = 'chips                               '
;

*/
