create or replace function ip_convert(strip in String) return integeras
declare ip1 varchar(10);
declare ip2 varchar(10);
declare ip3 varchar(10);
declare ip4 varchar(10);
declare temp varchar(20);
declare result integer;
begin@temp:=String;
@ip1:=substr(@temp, 1,INSTR (@temp, '.', 1,1)-1);
@ip2:=substr(@temp,INSTR (@temp, '.', 1,1)+1,INSTR (@temp, '.', 1,2)-length(@ip1)-2 ) ;
@ip3:=substr(@temp,INSTR (@temp, '.', 1,2)+1,INSTR (@temp, '.', 1,3)-length(@ip1)-length(@ip2)-3 ) ;
@ip4:=substr(@temp,INSTR (@temp, '.', 1,3)+1,length(@temp)-length(@ip1)-length(@ip2)-4 ) ;
@result:=`CONVERT`(@ip1,int)*16777216+`CONVERT`(@ip2,int)*65536+`CONVERT`(@ip3,int)*256+`CONVERT`(@ip4,int);return(result);
end ip_convert;
ERROR 1064 (42000): 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 'function ip_convert(strip in String) return integerasdeclare ip1 varchar(10);' at line 1
declare ip1 varchar(10);
declare ip2 varchar(10);
declare ip3 varchar(10);
declare ip4 varchar(10);
declare temp varchar(20);
declare result integer;
begin@temp:=String;
@ip1:=substr(@temp, 1,INSTR (@temp, '.', 1,1)-1);
@ip2:=substr(@temp,INSTR (@temp, '.', 1,1)+1,INSTR (@temp, '.', 1,2)-length(@ip1)-2 ) ;
@ip3:=substr(@temp,INSTR (@temp, '.', 1,2)+1,INSTR (@temp, '.', 1,3)-length(@ip1)-length(@ip2)-3 ) ;
@ip4:=substr(@temp,INSTR (@temp, '.', 1,3)+1,length(@temp)-length(@ip1)-length(@ip2)-4 ) ;
@result:=`CONVERT`(@ip1,int)*16777216+`CONVERT`(@ip2,int)*65536+`CONVERT`(@ip3,int)*256+`CONVERT`(@ip4,int);return(result);
end ip_convert;
ERROR 1064 (42000): 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 'function ip_convert(strip in String) return integerasdeclare ip1 varchar(10);' at line 1