RE: funcion plpgsql

From: Javier Bermúdez Tito <javier_bt(at)hotmail(dot)com>
To: msotocl(at)gmail(dot)com
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: RE: funcion plpgsql
Date: 2007-01-09 19:45:22
Message-ID: BAY129-F50C34EA2A97CB068CA5B585B30@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Me falto ponerle IN

FOR rd_data IN SELECT s.idcsucur, s.saucnosu, s.saucdire FROM sucursales s
WHERE s.eliminar = 0 ORDER BY s.saucnosu ASC LOOP
...

pruebalo

asi podras obtener todos los datos pruebalo y acondicionalo para tu consulta
segun tus criterios.

CREATE OR REPLACE FUNCTION "public"."get_rec" (VARCHAR, INTEGER, VARCHAR)
RETURNS SETOF "public"."ty_rec" AS
$body$
DECLARE
rd_data ty_rec%ROWTYPE;
BEGIN
FOR rd_data SELECT s.idcsucur, s.saucnosu, s.saucdire FROM sucursales s
WHERE s.eliminar = 0 ORDER BY s.saucnosu ASC LOOP
RETURN NEXT rd_data;
END LOOP;
END;
$body$
LANGUAGE 'plpgsql';

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

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Agustin Casiva 2007-01-09 19:54:32 Re: Like iLike y Genexus
Previous Message Mario Soto 2007-01-09 19:44:01 Re: funcion plpgsql