salix/db/routines/vn/procedures/address_updateCoordinates.sql

26 lines
574 B
MySQL
Raw Normal View History

2024-07-09 08:01:32 +00:00
DELIMITER $$
2024-07-11 08:23:31 +00:00
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_updateCoordinates`(
2024-07-09 08:01:32 +00:00
vTicketFk INT,
vLongitude DECIMAL(11,7),
vLatitude DECIMAL(11,7))
2024-07-09 08:01:32 +00:00
BEGIN
/**
2024-07-11 09:52:27 +00:00
* Actualiza las coordenadas de una dirección.
2024-07-09 08:01:32 +00:00
*
2024-07-11 09:43:19 +00:00
* @param vTicketFk Id del ticket
2024-07-11 09:57:48 +00:00
* @param vLongitude Longitud de la dirección
* @param vLatitude Latitud de la dirección
2024-07-09 08:01:32 +00:00
*/
DECLARE vAddressFK INT;
SELECT addressFK INTO vAddressFK
FROM ticket
2024-07-11 08:23:31 +00:00
WHERE id = vTicketFk;
2024-07-09 08:01:32 +00:00
UPDATE address
SET longitude = vLongitude,
latitude = vLatitude
WHERE id = vAddressFK;
END$$
DELIMITER ;