Hola!!!
Cambié el AS por INTO y me da el siguiente error

ERROR:  invalid input syntax for integer: "2.34898380940343"
CONTEXT:  PL/pgSQL function "calculo_distancia" while casting return value
to function's return type

********** Error **********

ERROR: invalid input syntax for integer: "2.34898380940343"
SQL state: 22P02
Context: PL/pgSQL function "calculo_distancia" while casting return value to
function's return type





El 12 de agosto de 2011 12:45, Alvaro Herrera <alvhe...@alvh.no-ip.org>escribió:

> Excerpts from Virginia's message of vie ago 12 12:28:36 -0400 2011:
>
> > BEGIN
> >     SELECT (acos(sin(radians(LATITUD_1)) * sin(radians(LATITUD_2)) +
> >     cos(radians(LATITUD_1)) * cos(radians(LATITUD_2)) *
> >     cos(radians(LONGITUD_1) - radians(LONGITUD_2))) * 6378) as resultado;
> >     RETURN resultado;
>
> Usa INTO, no AS.
>
> --
> Álvaro Herrera <alvhe...@alvh.no-ip.org>
>

Responder a