RE: CREATE OR REPLACE FUNCTION

From: "Edwin Quijada" <listas_quijada(at)hotmail(dot)com>
To: mmartinez(at)movilmaster(dot)cl
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: RE: CREATE OR REPLACE FUNCTION
Date: 2004-10-14 16:19:36
Message-ID: BAY1-F330dMypOUR7Zt00026702@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

CREATE OR REPLACE FUNCTION selectcalles(text, text)
> RETURNS callesstgo AS
> 'DECLARE
> res text;
reg record;
> BEGIN
> select into reg * from callesstgo where
>distance(GeometryFromText(''POINT('' ||
>$1
> || '' '' || $2 || '') '',-1),the_geom) < 25;
> END;'
> LANGUAGE 'plpgsql' VOLATILE;

te vfalta el retunr

*-------------------------------------------------------*
*-Edwin Quijada
*-Developer DataBase
*-JQ Microsistemas
*-809-747-2787
* " Si deseas lograr cosas excepcionales debes de hacer cosas fuera de lo
comun"
*-------------------------------------------------------*

>From: Mariela Martinez <mmartinez(at)movilmaster(dot)cl>
>To: pgsql-es-ayuda(at)postgresql(dot)org
>Subject: [pgsql-es-ayuda] CREATE OR REPLACE FUNCTION
>Date: Wed, 13 Oct 2004 16:45:19 +0200
>
>
> Por favor, necesito ayuda con esta función:
>
> CREATE OR REPLACE FUNCTION selectcalles(text, text)
> RETURNS callesstgo AS
> 'DECLARE
> res text;
> BEGIN
> select * from callesstgo where distance(GeometryFromText(''POINT('' ||
>$1
> || '' '' || $2 || '') '',-1),the_geom) < 25;
> END;'
> LANGUAGE 'plpgsql' VOLATILE;
>
> Necesito traer un conjunto de registros, pero cuando la ejecuto me trae
>el
> siguiente error:
>ERROR: SELECT query has no destination for result data.
> If you want to discard the results, use PERFORM instead.
>
> Estoy trabajando con PostGreSQL 7.3
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 9: el optimizador ignorará el uso de recorridos de índice si los
> tipos de datos de las columnas no coinciden

_________________________________________________________________
MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Edwin Quijada 2004-10-14 16:32:47 Re: SPS + funciones
Previous Message angel Iracheta 2004-10-14 15:32:12 Re: Sumar Dias a una Fecha