日期:2014-05-16  浏览次数:20720 次

为什出错 给高分
DROP PROCEDURE if EXISTS pro_up_game;
create PROCEDURE pro_up_game
  (id int,String_value VARCHAR(200),
  OUT Sok INT,out Error_descript varchar(100))
BEGIN
  DECLARE V_sql VARCHAR(200);
  DECLARE _err int DEFAULT 1;
  DECLARE Error varchar(200) DEFAULT 'Success';
  DECLARE CONTINUE HANDLER FOR NOT FOUND, SQLEXCEPTION,SQLWARNING
  set _err= -1,Error = 'SQLWaring or NOT FOUND or SQLException';  
  set V_sql = CONCAT('update game set ',String_value,' where gid =',id);
  SELECT V_sql;
  PREPARE stmt1 from @V_sql;
  EXECUTE stmt1 ;
  set Sok = _err,Error_descript=Error;
  select Sok,Error;
END

为什么执行会有错误

 call pro_up_game('4','gname =''国杀''',@Sok,@Error_descript);

还有这个异常如何该 可以显示详细的异常信息;

------解决方案--------------------
你把错误的提示放出来撒,这样你好别人也好看么
------解决方案--------------------
引用 SELECT V_sql;
PREPARE stmt1 from @V_sql;