mach es so
Code
DROP PROCEDURE IF EXISTS `resetLifeVehicles`;
DROP PROCEDURE IF EXISTS `deleteDeadVehicles`;
DROP PROCEDURE IF EXISTS `deleteOldHouses`;
DROP PROCEDURE IF EXISTS `deleteOldGangs`;
DROP PROCEDURE IF EXISTS `deleteOldContainers`;
DROP PROCEDURE IF EXISTS `deleteOldWanted`;
DELIMITER $$
--
-- Procedures
-- CURRENT_USER function returns the name of the current user in the SQL Server database.
--
CREATE DEFINER=CURRENT_USER PROCEDURE `resetLifeVehicles`()
BEGIN
UPDATE `vehicles` SET `active`= 0;
END$$
CREATE DEFINER=CURRENT_USER PROCEDURE `deleteDeadVehicles`()
BEGIN
DELETE FROM `vehicles` WHERE `alive` = 0;
END$$
CREATE DEFINER=CURRENT_USER PROCEDURE `deleteOldHouses`()
BEGIN
DELETE FROM `houses` WHERE `owned` = 0;
END$$
CREATE DEFINER=CURRENT_USER PROCEDURE `deleteOldGangs`()
BEGIN
DELETE FROM `gangs` WHERE `active` = 0;
END$$
CREATE DEFINER=CURRENT_USER PROCEDURE `deleteOldContainers`()
BEGIN
DELETE FROM `containers` WHERE `owned` = 0;
END$$
CREATE DEFINER=CURRENT_USER PROCEDURE `deleteOldWanted`()
BEGIN
DELETE FROM `wanted` WHERE `active` = 0;
END$$
DELIMITER ;
Alles anzeigen