一,朋友创建存储函数报错。
CREATE DEFINER=`root`@`localhost` FUNCTION `stuff`(
f_old varchar(1000),f_start int,f_length int,f_replace varchar(1000)
) RETURNS varchar(2000) CHARSET utf8
BEGIN
return replace(f_old,substring(f_old,f_start,f_length),f_replace);
END
[SQL] create FUNCTION f_Int2IP (ip bigint) RETURNS varchar(15)
BEGIN
DECLARE re varchar(15) default '';
SELECT concat('.',CAST(ip/id as char)),ip%id into re,ip
from(
SELECT 16777216 as id
UNION ALL SELECT 65536
UNION ALL SELECT 256
UNION ALL SELECT 1) a;
set
RETURN STUFF(re,1,1,'');
END
报错如下:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to