我有这个从PHP脚本调用的存储过程。它有很少的select语句和delete语句。除了DELETE查询没有执行之外,一切正常。它会被忽略!!请帮忙。感谢
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;
答案 0 :(得分:0)