I'm creating a procedure, which receives a string '2015-09-11', verifies that it is indeed a Monday, if not, it picks up that date and plays Monday of the week itself. But my concept with sql is pretty weak, my base is this way.
DROP PROCEDURE IF EXISTS SP_DATA_PARA_SEGUNDA;
DELIMITER //
CREATE PROCEDURE SP_DATA_PARA_SEGUNDA (IN SPA_DATA_CONVERTER DATE,INOUT SPA_DATA_CONVERTIDA INT)
BEGIN
SELECT DATE_FORMAT(SPA_DATA_CONVERTER,'%w');
END//
DELIMITER ;
Now it works, but now I want to return that dateformat in my SPA_DATA_CONVERTIDA argument, how do I?