uando agrego el procedimiento:
Código PHP:
DELIMITER $$
DROP PROCEDURE IF EXISTS `cosit`.`procedure1` $$
CREATE PROCEDURE `cosit`.`procedure1` ()
BEGIN
IF (SELECT COUNT(*) FROM trabajadores WHERE id = 162) IS NULL THEN
SELECT * FROM prot_exclusion;
ELSE
SELECT * FROM trabajadores WHERE id = 1;
END IF;
END $$
DELIMITER ;
me da error:
Cita: Error
SQL query:
DELIMITER $$
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1
pero si le quito DELIMITER $$ y el DELIMITER ; me dice:
Cita: DROP PROCEDURE IF EXISTS `cosit`.`procedure1` $$# MySQL returned an empty result set (i.e. zero rows).
CREATE PROCEDURE `cosit`.`procedure1` (
) BEGIN IF( SELECT COUNT( * )
FROM trabajadores
WHERE id =162 ) IS NULL
THEN
SELECT *
FROM prot_exclusion;
ELSE SELECT *
FROM trabajadores
WHERE id =1;
END IF ;
END $$# MySQL returned an empty result set (i.e. zero rows).
Sigue sin mostrar algo ;(
gracias.