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;
12 个解决方案
#1
出现如下的错误
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 ' sqlt:='UPDATE '||tableName||' set '||fieldNmae|| ' = replace('||fieldNmae|| ',chr(10' at line 11'
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 ' sqlt:='UPDATE '||tableName||' set '||fieldNmae|| ' = replace('||fieldNmae|| ',chr(10' at line 11'
#2
换成set sqlt='UPDATE '||tableName||' set '||fieldNmae|| ' = replace('||fieldNmae|| ',chr(10), ' ' ' ' ) where '||fieldNmae|| ' like ''%'||chr(10)||'%'';
看看
看看
#3
||->CONCAT
你是在MYSQL命令行下输入?
delimiter $$
create function ...
$$
delimiter ;
你是在MYSQL命令行下输入?
delimiter $$
create function ...
$$
delimiter ;
#4
还有仔细检查一下后边拼接的%转译有没有错
#5
2L 正解 !设为set就可以啦 请在问下 在怎么执行那个sqlt
#6
是MYSQL?
#7
我还真没见过函数执行这类sqlt的,求指教。。。
#8
6L是Mysql 就是自己组装一个sql语句 然后在怎么执行
#9
set @asql=你的SQL语句;
prepare stml from @asql;
execute stml;
prepare stml from @asql;
execute stml;
#10
在函数中允许动态sql吗?
#11
这是是要写在一个funtion中 ,这样直接不行把
#12
可以直接写在命令行中,也可以写在存储过程中。
#1
出现如下的错误
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 ' sqlt:='UPDATE '||tableName||' set '||fieldNmae|| ' = replace('||fieldNmae|| ',chr(10' at line 11'
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 ' sqlt:='UPDATE '||tableName||' set '||fieldNmae|| ' = replace('||fieldNmae|| ',chr(10' at line 11'
#2
换成set sqlt='UPDATE '||tableName||' set '||fieldNmae|| ' = replace('||fieldNmae|| ',chr(10), ' ' ' ' ) where '||fieldNmae|| ' like ''%'||chr(10)||'%'';
看看
看看
#3
||->CONCAT
你是在MYSQL命令行下输入?
delimiter $$
create function ...
$$
delimiter ;
你是在MYSQL命令行下输入?
delimiter $$
create function ...
$$
delimiter ;
#4
还有仔细检查一下后边拼接的%转译有没有错
#5
2L 正解 !设为set就可以啦 请在问下 在怎么执行那个sqlt
#6
是MYSQL?
#7
我还真没见过函数执行这类sqlt的,求指教。。。
#8
6L是Mysql 就是自己组装一个sql语句 然后在怎么执行
#9
set @asql=你的SQL语句;
prepare stml from @asql;
execute stml;
prepare stml from @asql;
execute stml;
#10
在函数中允许动态sql吗?
#11
这是是要写在一个funtion中 ,这样直接不行把
#12
可以直接写在命令行中,也可以写在存储过程中。