Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/08/2011, 11:26
Avatar de RIVERMILLOS
RIVERMILLOS
 
Fecha de Ingreso: marzo-2010
Mensajes: 1.336
Antigüedad: 14 años, 1 mes
Puntos: 15
Concaternar valores en una funcion.

Hola estoy intentando agregarle una funcino a mysql para el calculo de distacia entre dos puntos , con esta funcion no me funciona me retorna null no se porque.

Código MySQL:
Ver original
  1. -- Switch delimiter so the ; will work in the function body
  2. DELIMITER $$
  3.  
  4. -- Create the function
  5.     COMMENT 'Calculate the distance between two points'
  6.     BEGIN
  7.         RETURN glength(linestringfromwkb(linestring(asbinary(a), asbinary(b))));
  8.     END$$
  9.  
  10. -- Switch the delimiter back to ;
  11. DELIMITER ;

pero si cambio el select por algo asi

Código MySQL:
Ver original
  1. SELECT GLength(GeomFromText('linestring(-74.03030396 4.6709496582031,-74.556452 4.670076531)'));


si me funciona, pero no se como hacer para colocar los parametros de la funcion dentro de la consulta.



saludos