我剛剛在數據庫(name : db)
中創建了一個程序(name : 'delete_catelog_item does')
,並試圖運行該程序。然後,我收到如下錯誤#1305 - PROCEDURE db.procedurename does not exist
。1305 - 程序db.delete_catelog_item不存在
我的查詢
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
我想不通的實際原因,但是當我在我的數據庫查詢的程序它的存在。 請幫助找到問題。
謝謝。
1305 - PROCEDURE db.delete_catelog_item不存在,這是我得到的實際錯誤消息。我試圖用我創建的相同名稱來調用過程。 – 2012-04-27 14:01:47
@LucilSandaruwan:好的。也許你應該編輯你的問題來糾正那裏的消息? 'db'是您創建過程的數據庫的名稱? – eggyal 2012-04-27 14:03:27
是db是db的名字。 – 2012-04-27 15:23:50