From: | Virginia <mavir78(at)gmail(dot)com> |
---|---|
To: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
Cc: | Ayuda <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: [pgsql-es-ayuda] ayuda con función |
Date: | 2011-08-12 18:38:48 |
Message-ID: | CAKCW+TcE+DyztUeDNXyvTza-sY+os_Q+7DaGRoo849dHX=MQJQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
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 <alvherre(at)alvh(dot)no-ip(dot)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 <alvherre(at)alvh(dot)no-ip(dot)org>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Juan | 2011-08-12 18:42:55 | Re: [pgsql-es-ayuda] Re: [pgsql-es-ayuda] ayuda con función |
Previous Message | Javier Aquino H. | 2011-08-12 18:13:51 | RE: Columna Error en Primary Key |