我刚刚(name : 'delete_catelog_item does')
在数据库中创建了一个过程(name : db)
并尝试运行该过程。然后我收到这样的错误#1305 - PROCEDURE db.procedurename does not exist
。
我的查询
DELIMITER //
CREATE DEFINER=`root`@`localhost` PROCEDURE `delete_catelog_item`(IN itemtocatid INT(11),IN shopinid INT(11),OUT out_put BOOL)
BEGIN
DECLARE cont INT(11);
DECLARE itemid INT(11) DEFAULT 0;
SELECT a.ItmId INTO itemid FROM mas_shop_item_to_category as a INNER JOIN mas_shop_item as b ON (a.ItmID=b.ItmID AND b.IsDelete!=1 AND b.ShopID IN (SELECT ShopID FROM mas_shop WHERE ShopID=shopinid OR ParentID=shopinid)) WHERE a.ItmToCatID=itemtocatid AND a.IsDelete!=1;
IF itemid!=0 THEN
UPDATE mas_shop_item_to_category SET `IsDelete` = '1' WHERE ItmToCatID=itemtocatid;
SELECT count(ItmToCatID) INTO cont FROM mas_shop_item_to_category WHERE ItmId=itemid AND IsDelete!=1;
IF cont=0 THEN
UPDATE mas_shop_item SET `IsDelete` = '1' WHERE ItmID=itemid;
END IF;
SET out_put=TRUE;
ELSE
SET out_put=FALSE;
END IF;
END //
DELIMITER ;
Apache/2.2.14 (Ubuntu)
MySQL client version: 5.1.41
PHP extension: mysql
我无法弄清楚实际原因,但是当我检查数据库中的程序时,它就在那里。请帮助查找问题。
谢谢你。