存储过程中缺少分号错误 mysql workbench
MIssing semicolon error in stored procedure mysql workbench
嗨,我是 mysql 的新手,正在尝试通过存储的 procedure.I 更新 table 时出现“缺少分号 error.I 尝试了所有方法,但我无法做到明白为什么会这样。
程序:
DROP PROCEDURE IF EXISTS abc;
use smartdata;
DELIMITER $$
CREATE PROCEDURE abc(IN datasourceId int)
begin
update DM_Sample_Search_Param_Disposition_Type set DM_Sample_Search_Param_Disposition_Type.Active = 0
From DM_Sample_Search_Param_Disposition_Type dm_ss_param_cl
left join DM_Sample_Search_Param dm_ss_param on dm_ss_param_cl.DM_Sample_Search_Param_id =dm_ss_param.DM_Sample_Search_Param_id
left join DM_Sample_Store dm_ss on dm_ss.DM_Sample_Store_Id=dm_ss_param.DM_Sample_Store_Id
where dm_ss.Datasource_Id=datasourceId;
end $$
DELIMITER //
下一行附近出错:
set DM_Sample_Search_Param_Disposition_Type.Active = 0
其中 "Active" 在 table.Please 帮助中是 tinyint
MySQL 使用与 MSSQL 不同的更新语法:update ... join .. set ... where ...
update DM_Sample_Search_Param_Disposition_Type dm_ss_param_cl
left join DM_Sample_Search_Param dm_ss_param on dm_ss_param_cl.DM_Sample_Search_Param_id =dm_ss_param.DM_Sample_Search_Param_id
left join DM_Sample_Store dm_ss on dm_ss.DM_Sample_Store_Id=dm_ss_param.DM_Sample_Store_Id
set DM_Sample_Search_Param_Disposition_Type.Active = 0
where dm_ss.Datasource_Id=datasourceId;
加入错误 table 语法
update DM_Sample_Search_Param_Disposition_Type as dm_ss_param_cl
left join DM_Sample_Search_Param dm_ss_param on dm_ss_param_cl.DM_Sample_Search_Param_id =dm_ss_param.DM_Sample_Search_Param_id
left join DM_Sample_Store dm_ss on dm_ss.DM_Sample_Store_Id=dm_ss_param.DM_Sample_Store_Id
set DM_Sample_Search_Param_Disposition_Type.Active = 0
where dm_ss.Datasource_Id=datasourceId;
嗨,我是 mysql 的新手,正在尝试通过存储的 procedure.I 更新 table 时出现“缺少分号 error.I 尝试了所有方法,但我无法做到明白为什么会这样。
程序:
DROP PROCEDURE IF EXISTS abc;
use smartdata;
DELIMITER $$
CREATE PROCEDURE abc(IN datasourceId int)
begin
update DM_Sample_Search_Param_Disposition_Type set DM_Sample_Search_Param_Disposition_Type.Active = 0
From DM_Sample_Search_Param_Disposition_Type dm_ss_param_cl
left join DM_Sample_Search_Param dm_ss_param on dm_ss_param_cl.DM_Sample_Search_Param_id =dm_ss_param.DM_Sample_Search_Param_id
left join DM_Sample_Store dm_ss on dm_ss.DM_Sample_Store_Id=dm_ss_param.DM_Sample_Store_Id
where dm_ss.Datasource_Id=datasourceId;
end $$
DELIMITER //
下一行附近出错:
set DM_Sample_Search_Param_Disposition_Type.Active = 0
其中 "Active" 在 table.Please 帮助中是 tinyint
MySQL 使用与 MSSQL 不同的更新语法:update ... join .. set ... where ...
update DM_Sample_Search_Param_Disposition_Type dm_ss_param_cl
left join DM_Sample_Search_Param dm_ss_param on dm_ss_param_cl.DM_Sample_Search_Param_id =dm_ss_param.DM_Sample_Search_Param_id
left join DM_Sample_Store dm_ss on dm_ss.DM_Sample_Store_Id=dm_ss_param.DM_Sample_Store_Id
set DM_Sample_Search_Param_Disposition_Type.Active = 0
where dm_ss.Datasource_Id=datasourceId;
加入错误 table 语法
update DM_Sample_Search_Param_Disposition_Type as dm_ss_param_cl
left join DM_Sample_Search_Param dm_ss_param on dm_ss_param_cl.DM_Sample_Search_Param_id =dm_ss_param.DM_Sample_Search_Param_id
left join DM_Sample_Store dm_ss on dm_ss.DM_Sample_Store_Id=dm_ss_param.DM_Sample_Store_Id
set DM_Sample_Search_Param_Disposition_Type.Active = 0
where dm_ss.Datasource_Id=datasourceId;