更新未在MySql中编译的存储过程

时间:2014-10-06 03:34:29

标签: mysql stored-procedures

我正在尝试创建一个存储过程来更新MySql数据库中表的字段值。尝试运行查询时,我一直收到错误消息。下面是我得到的错误和存储过程。任何帮助将不胜感激。

Query: CREATE DEFINER=`YHI`@`%` PROCEDURE `update_ore_prices`( IN veldspar_isk decimal(10,2) ) BEGIN Update Ore_Ice_Prices SET( veldspa...

Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(
    veldspar_isk = veldspar,

);
END' at line 6

查询:

 DELIMITER $$

 USE `YHI`$$

DROP PROCEDURE IF EXISTS `update_ore_prices`$$

CREATE DEFINER=`YHI`@`%` PROCEDURE `update_ore_prices`(
IN veldspar_isk DECIMAL(10,2)
)
BEGIN
UPDATE Ore_Ice_Prices
SET(
    veldspar = veldspar_isk,

);
END$$

DELIMITER ;

1 个答案:

答案 0 :(得分:0)

更改:

UPDATE Ore_Ice_Prices
SET(
    veldspar = veldspar_isk,

);

UPDATE Ore_Ice_Prices
SET veldspar = veldspar_isk;

DELIMITER $$

USE `YHI`$$

DROP PROCEDURE IF EXISTS `update_ore_prices`$$

CREATE DEFINER=`YHI`@`%` PROCEDURE `update_ore_prices`(
IN veldspar_isk DECIMAL(10,2)
)
BEGIN
UPDATE Ore_Ice_Prices SET veldspar = veldspar_isk;
END$$