我是编写存储过程的新手,我似乎在这个过程中找不到错误。错误标记在 where 部分附近。
我尝试寻找一个基于 if 条件完成设置的示例,但我似乎找不到这样的示例。谁能指出我的错误?
DELIMITER $$
CREATE PROCEDURE `incubation`.`bt_voice_modification`
(in input_slot varchar(45),in input_port varchar(45))
BEGIN
SET @SVLAN_STH:=1000;
SET @SVLAN_DTH:=999;
SET @CVLAN_DTH:=1000;
SET @FLOW_INSTANCE:=1;
UPDATE one_2_one_table
SET L2S_USER_FLOW_INSTANCE = @FLOW_INSTANCE := @FLOW_INSTANCE+1;
SET L2S_NW_SLOT = input_slot;
SET L2S_NW_PORT = input_port;
IF STH_DTH = 'STH' then
set L2S_NW_SVLAN = @SVLAN_STH :=@SVLAN_STH + 1;
ELSE
set L2S_NW_SVLAN = @SVLAN_DTH ;
set L2S_NW_CVLAN = @CVLAN_DTH :=@CVLAN_DTH + 1;
END if;
WHERE IPDSLAM_USER_SLOT = 2 AND L2S_USER_TYPE like "%gplt%";
END