16 lines
451 B
SQL
16 lines
451 B
SQL
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_getRequestProblem`()
|
|
BEGIN
|
|
/**
|
|
* Actualiza los problemas de tickets que tienen una petición de compra pendiente o
|
|
* deja de tenerla
|
|
* @table tmp.ticket(ticketFk, hasProblem)
|
|
*/
|
|
UPDATE tmp.ticket t
|
|
JOIN ticketRequest tr ON tr.ticketFk = t.ticketFk
|
|
SET t.hasProblem = TRUE
|
|
WHERE tr.isOK IS NULL;
|
|
|
|
CALL ticket_setProblem('hasTicketRequest');
|
|
END$$
|
|
DELIMITER ; |