title: Stored function with multiple parameters and return type
body: <p>I am trying to implement the following stored procedure but it's not getting created :</p>
  
  <pre><code>  DELIMITER  //
  CREATE Function 'geodistkm'   
  (lat1  FLOAT ,  lon1  FLOAT,  lat2 FLOAT ,  lon2 FLOAT) 
  returns FLOAT
  BEGIN
   DECLARE pi, q1, q2, q3 FLOAT;
   DECLARE rads FLOAT DEFAULT 0;
   SET pi = PI();
   SET lat1 = lat1 * pi / 180;
   SET lon1 = lon1 * pi / 180;
   SET lat2 = lat2 * pi / 180;
   SET lon2 = lon2 * pi / 180;
   SET q1 = COS(lon1-lon2);
   SET q2 = COS(lat1-lat2);
   SET q3 = COS(lat1+lat2);
   SET rads = ACOS( 0.5*((1.0+q1)*q2 - (1.0-q1)*q3) ); 
   RETURN 6378.388 * rads;
  END ;
  //
  
  DELIMITER ;
  </code></pre>
  
  <p>I can't seem to figure out what's wrong with it . </p>