SQLyog中删除的存储过程

时间:2012-12-21 09:24:30

标签: sqlyog

DELIMITER $$

DROP PROCEDURE IF EXISTS `payroll`.`usp_DeleteDesignation`$$

CREATE PROCEDURE `payroll`.`usp_DeleteDesignation`
(
IN DesgID int(11)
)
    /*LANGUAGE SQL
    | [NOT] DETERMINISTIC
    | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
    | SQL SECURITY { DEFINER | INVOKER }
    | COMMENT 'string'*/
    BEGIN
DELETE from info_designation 
(
Desg_ID,
Designation,
Desg_Description,
CreatedBy,
CreatedOn,
UpdatedBy,
UpdatedOn,
DeletedFlag
)
where
Desg_ID = DesgID;

    END$$

DELIMITER ;

错误: (0行(s)受影响) (0毫秒)

错误代码:1064 您的SQL语法有错误;查看与您的MySQL服务器版本对应的手册,以便在'附近使用正确的语法'( Desg_ID, 指定, Desg_Description, 由...制作, 创建于, UpdatedBy,'第12行 (0毫秒)

1 个答案:

答案 0 :(得分:0)

而不是

BEGIN DELETE from info_designation 
( Desg_ID, Designation, Desg_Description, CreatedBy, 
CreatedOn, UpdatedBy, UpdatedOn, DeletedFlag ) 
where Desg_ID = DesgID;

应该是

BEGIN DELETE from info_designation where Desg_ID = DesgID;