0

I have a procedure for delete some datas from my mysql table,

My Procedure is like ,

DELIMITER $$

USE `callerlog_forlive`$$

DROP PROCEDURE IF EXISTS `delete_custom_fields`$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `delete_custom_fields`(IN DeletedFields TEXT)
BEGIN
 DELETE FROM `project_custom_fields` WHERE `CustomFieldId` IN (DeletedFields);
END$$

DELIMITER ;

and my procedure call be like call delete_custom_fields("1,2");

but its not working. I think its because of double quotes in the input (Iam not sure). How to resolve this ???

Thank You

JIJOMON K.A
  • 1,290
  • 3
  • 12
  • 29

1 Answers1

0

You can use json_unquote:

select json_unquote('"1,2"')

result: 1,2

Lior Bar-On
  • 10,784
  • 5
  • 34
  • 46