一、sql_mode问题sql
SET @v_rowcount = 0; select count(*) into @v_rowcount from dual where exists (select * from businstep where finance_type='5' and businflow_id='0' and step_no=3); SET @sql = IF(@v_rowcount = 0,"insert into businstep(finance_type,businflow_id,step_no,step_name,step_caption,menu_id,warn_type,pre_step_str,auto_flag) values('5','0',3,'期货清算入帐',' ',210106,'0',' ','1'); ","update businstep set step_name='期货清算入帐' , step_caption=' ' , menu_id=210106 , warn_type='0' , pre_step_str=' ' , auto_flag='1' where finance_type='5' and businflow_id='0' and step_no=3;"); PREPARE stmt FROM @sql; EXECUTE stmt;
执行的时候报以下错误:oracle
缘由是: sql_mode=oracle 不支持双引号spa
解决方式为:修改Mariadb的配置文件配置文件路径:/etc/my.cnf.d/server.cnf),将原有oracle的配置模式中‘ANSI_QUOTES’去除,即将sql_mode的值修改成'PIPES_AS_CONCAT,IGNORE_SPACE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER' ;3d