I need to create a stored procedure in mysql to delete multiple records from a table by providing list of id as a comma separated list.
example
(please note that Id column in the table is integer)
DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `deleteLines`(IN $ids varchar(1000))
BEGIN
select * from line where $ids in ($ids);
END$$
DELIMITER;
CALL deleteLines('1,3,5,12');
What is the best way to delete multiple records in this scenario?