2017-02-23 131 views
0

我得到以下代码的错误!请帮助MySQL错误代码:1064.您的SQL语法错误;

错误代码:1064.您的SQL语法错误;检查对应于你的MySQL服务器版本的在线使用近“NULL”正确的语法手册1


- 常规DDL - 注:之前和之后的例行身体的意见将不会服务器


DELIMITER $$ 

CREATE DEFINER=`C_sshankaranar`@`%` PROCEDURE `SIT1_NullCheck`(IN tName Varchar(50),IN attribute Varchar(50),Out NullCount int(11),Out PC Varchar(200),Out x int(11)) 
BEGIN 


set @Sl=NULL; 

set @S1 = Concat('select count(*) into @NullCount from SIT1_STG.',tName,' where ',attribute,' is NULL or ',attribute,'='''); 
Prepare stmt from @Sl; 
Execute stmt; 

select SI into @x from dev2_stg2.Null_Check where Table_Name=tName; 


If (@NullCount<>0) then 

select Problem_Columns into @PC from dev2_stg2.Null_Check where [email protected]; 

Update dev2_stg2.Null_Check set Problem_Columns=Concat(@PC,' ',attribute) where [email protected]; 


End IF; 

Update dev2_stg2.Null_Check 
set Environment="SIT1_STG" 
where [email protected]; 

Update dev2_stg2.Null_Check 
set Update_Time=Now() 
where [email protected]; 

END 

回答

-1

看起来像是准备好的声明中构建SELECT查询存储不正确。

查询的末尾有语法错误,这样的事情 -

SELECT... or attr=' 

输出与另一个SELECT查询,以检查它 -

BEGIN 
    set @S1 = Concat... 
    SELECT @S1; 
END 
相关问题