I have this stored procedure which gets called from PHP Script. It has few select statement and a delete statement. Everything works fine apart from DELETE query does not get executed. It gets ignored !! Please help. Thanks
CREATE PROCEDURE `proc_name`(IN id INT, IN type CHAR(50))
DETERMINISTIC
COMMENT 'procedure'
BEGIN
DECLARE LEGACY_EN_ID INT;
SET IN_ID = id;
SELECT IF(e.legacy_id > 0, e.legacy_id, 0) INTO LEGACY_EN_ID FROM tablename e WHERE e.id = IN_ID LIMIT 1;
/* Delete record if it exists */
DELETE
FROM tablename
WHERE entityID = LEGACY_EN_ID;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.