mysql 在创建function出错 在线等 急用!求指教
BEGIN
declare sqlt varchar(500);
update mn_ammeter set STRADDRESS=replace(STRADDRESS,'\\','/') where STRADDRESS like '%\%';
update mn_ammeterdisplaytype set strname=replace(strname,chr(10),'') where strname like '%'||chr(10)||'%';
UPDATE mn_box set straddress = replace(straddress,chr(10 ),'') where straddress like '%'||chr(10)||'%';
sqlt:='UPDATE '||tableName||' set '||fieldNmae|| ' = replace('||fieldNmae|| ',chr(10), ' ' ' ' ) where '||fieldNmae|| ' like ''%'||chr(10)||'%'';
return 0;
end;
------解决方案--------------------换成set sqlt='UPDATE '||tableName||' set '||fieldNmae|| ' = replace('||fieldNmae|| ',chr(10), ' ' ' ' ) where '||fieldNmae|| ' like ''%'||chr(10)||'%'';
看看
------解决方案--------------------||->CONCAT
你是在MYSQL命令行下输入?
delimiter $$
create function ...
$$
delimiter ;
------解决方案--------------------set @asql=你的SQL语句;
prepare stml from @asql;
execute stml;
------解决方案--------------------