3

我刚刚(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

我无法弄清楚实际原因,但是当我检查数据库中的程序时,它就在那里。请帮助查找问题。

谢谢你。

4

2 回答 2

0

从您提供的错误消息来看,您似乎已经尝试CALL通过 name 来处理您的过程procedurename,而您的CREATE PROCEDURE声明给它的 name delete_catelog_item。您需要CALL使用定义它的名称!

于 2012-04-27T13:53:30.070 回答
0

我可以找出解决方案,问题出在数据库名称上。"."在我更改该名称后,它被命名为"first.second"问题不存在。谢谢你帮助我。

于 2012-05-01T06:52:49.973 回答