24 lines
513 B
SQL
24 lines
513 B
SQL
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `srt`.`buffer_setEmpty`(vBufferFk INT)
|
|
BEGIN
|
|
|
|
/**
|
|
* Actualiza a NULL el valor bufferFk de las expediciones que esten en ese buffer
|
|
*
|
|
* @param vBufferFk Identificador de srt.buffer
|
|
*
|
|
*/
|
|
|
|
UPDATE srt.expedition e
|
|
SET e.bufferFk = NULL
|
|
WHERE e.bufferFk = vBufferFk;
|
|
|
|
UPDATE srt.buffer b
|
|
SET b.typeFk = b.typeDefaultFk
|
|
WHERE b.id = vBufferFk;
|
|
|
|
CALL srt.buffer_setStateType(vBufferFk, 'FREE', NULL);
|
|
|
|
END$$
|
|
DELIMITER ;
|