mySQL存储过程创建报错,请大家帮我看看! 10
CREATEPROCEDURE`P_Mis_GetAccess`(param_UserIDint,param_MenuIDint,outparam_Access_IDin...
CREATE PROCEDURE `P_Mis_GetAccess`(
param_UserID int,
param_MenuID int,
out param_Access_ID int,
out param_Access_Name varchar(50),
out param_Access_CanRead varchar(6),
out param_Access_CanEdit varchar(6),
out param_Access_CanCheck varchar(6),
out param_Access_CanAdmin varchar(6)
)
Begin
DECLARE param_temp1 int default 0;
DECLARE param_temp2 int default 0;
select Access_ID into param_temp1 from t_Mis_Sys_AccessCode
where Access_ID=(select max(Access_Level) from t_Mis_Sys_RoleAccess where Access_Role in (
select Role_ID from t_Mis_Sys_Role where (select User_IsDeleted from t_Mis_Sys_User where User_ID= param_UserID )='F'
and Role_ID in (select Role_ID from t_Mis_Sys_UserRole where User_ID= param_UserID )
and Role_ID in (select Role_ID from t_Mis_Sys_Role where Role_ID in (select Role_id from t_Mis_Sys_UserRole where User_ID= param_UserID ) and Role_IsDeleted='F'))
and Access_Menu= param_MenuID );
select Access_ID into param_temp2 from t_Mis_Sys_AccessCode
where Access_ID=(select Access_LevelID from t_Mis_Sys_UserAccess where Access_UserID= param_UserID
and (select User_IsDeleted from t_Mis_Sys_User where User_ID= param_UserID )='F'and Access_MenuID= param_MenuID );
if param_temp2>param_temp1 then
set param_temp1=param_temp2;
end if;
select Access_ID into param_temp2 from t_Mis_Sys_AccessCode
where Access_ID=(select max(Com_LevelID) from t_Mis_SysCommision where Com_GetID=param_UserID
and (select User_IsDeleted from t_Mis_Sys_User where User_ID= param_UserID )='F'
and Com_MenuID= param_MenuID and now()>Com_StartTime and now()<Com_EndTime);
if param_temp2>param_temp1 then
set param_temp1=param_temp2;
end if;
select Access_ID,Access_Name,Access_CanRead,Access_CanEdit,Access_CanCheck,Access_CanAdmin
into param_Access_ID,param_Access_Name,param_Access_CanRead,param_Access_CanEdit,param_Access_CanCheck,param_Access_CanAdmin
from t_Mis_Sys_AccessCode where Access_ID=param_temp1;
End;
执行后报报“ 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 '' at line 12”
请大家帮我看看是什么问题,如何解决? 展开
param_UserID int,
param_MenuID int,
out param_Access_ID int,
out param_Access_Name varchar(50),
out param_Access_CanRead varchar(6),
out param_Access_CanEdit varchar(6),
out param_Access_CanCheck varchar(6),
out param_Access_CanAdmin varchar(6)
)
Begin
DECLARE param_temp1 int default 0;
DECLARE param_temp2 int default 0;
select Access_ID into param_temp1 from t_Mis_Sys_AccessCode
where Access_ID=(select max(Access_Level) from t_Mis_Sys_RoleAccess where Access_Role in (
select Role_ID from t_Mis_Sys_Role where (select User_IsDeleted from t_Mis_Sys_User where User_ID= param_UserID )='F'
and Role_ID in (select Role_ID from t_Mis_Sys_UserRole where User_ID= param_UserID )
and Role_ID in (select Role_ID from t_Mis_Sys_Role where Role_ID in (select Role_id from t_Mis_Sys_UserRole where User_ID= param_UserID ) and Role_IsDeleted='F'))
and Access_Menu= param_MenuID );
select Access_ID into param_temp2 from t_Mis_Sys_AccessCode
where Access_ID=(select Access_LevelID from t_Mis_Sys_UserAccess where Access_UserID= param_UserID
and (select User_IsDeleted from t_Mis_Sys_User where User_ID= param_UserID )='F'and Access_MenuID= param_MenuID );
if param_temp2>param_temp1 then
set param_temp1=param_temp2;
end if;
select Access_ID into param_temp2 from t_Mis_Sys_AccessCode
where Access_ID=(select max(Com_LevelID) from t_Mis_SysCommision where Com_GetID=param_UserID
and (select User_IsDeleted from t_Mis_Sys_User where User_ID= param_UserID )='F'
and Com_MenuID= param_MenuID and now()>Com_StartTime and now()<Com_EndTime);
if param_temp2>param_temp1 then
set param_temp1=param_temp2;
end if;
select Access_ID,Access_Name,Access_CanRead,Access_CanEdit,Access_CanCheck,Access_CanAdmin
into param_Access_ID,param_Access_Name,param_Access_CanRead,param_Access_CanEdit,param_Access_CanCheck,param_Access_CanAdmin
from t_Mis_Sys_AccessCode where Access_ID=param_temp1;
End;
执行后报报“ 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 '' at line 12”
请大家帮我看看是什么问题,如何解决? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询