1

救命啊!!!...下面有什么问题??我收到箭头指示的行的 SQL 语法错误号 1064。

CREATE PROCEDURE SP_IsProductInBasket (
  IN customerId INT(11),
  IN productId TINYTEXT
)
BEGIN
  SELECT
    products_id
  FROM customers_basket
  WHERE customers_id = customerId
    AND products_id = productId;    <------ error here????!!!
END

我已经验证了选择作为一个独立的作品可以正常工作

4

1 回答 1

1

尝试更改分隔符,

DELIMITER $$
CREATE PROCEDURE SP_IsProductInBasket 
(
  IN customerId INT(11),
  IN productId TINYTEXT
)
BEGIN
  SELECT   products_id
  FROM     customers_basket
  WHERE    customers_id = customerId AND 
           products_id = productId;   
END $$
DELIMITER ;
于 2012-09-04T13:15:00.917 回答