21 lines
563 B
MySQL
21 lines
563 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getTaxDataCheckedProblemAll`()
|
||
|
proc: BEGIN
|
||
|
/**
|
||
|
* Actualiza los problemas de los tickets de hoy y a futuro
|
||
|
* cuyos clientes tengan o no los datos comprobados
|
||
|
*/
|
||
|
|
||
|
CREATE OR REPLACE TEMPORARY TABLE tmp.ticket
|
||
|
(INDEX(ticketFk))
|
||
|
ENGINE = MEMORY
|
||
|
SELECT t.id ticketFk, FALSE hasProblem
|
||
|
FROM ticket t
|
||
|
JOIN client c ON c.id = t.clientFk
|
||
|
WHERE t.shipped >= util.midnight();
|
||
|
|
||
|
CALL ticket_getTaxDataCheckedProblem();
|
||
|
|
||
|
DROP TEMPORARY TABLE tmp.ticket;
|
||
|
END$$
|
||
|
DELIMITER ;
|