I'm trying to create a store procedure, but it throws me an error every time I try to run the code:
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 '' at line 10
This is the store procedure I'm trying to create:
CREATE DEFINER=`root`@`localhost` PROCEDURE getMantencionByPlate(
xParam char(10),
xParam2 char(10)
)
BEGIN
SELECT DISTINCT
*
FROM mantenciones
WHERE ifnull(estado,'')<>'ELIMINADO' and brainbox=xParam and patente=xParam2
ORDER BY fecing desc;
END
DELIMITER ;