From: | "Juan Carlos Badillo Goy" <badillo(at)cav(dot)desoft(dot)cu> |
---|---|
To: | <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: Ayuda con una sentencia SQL |
Date: | 2008-06-20 20:55:42 |
Message-ID: | 004701c8d318$00d9aac0$c901c0c0@cav.desoft.cu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Ahora estoy tratando de hacer que una función me retorne lo siguiente: (la
suma o union por asi decirlo de rs_tabla_1 y rs_tabla_2 )
CREATE OR REPLACE FUNCTION "public"."funct_resultante" (aid_usuario integer)
RETURNS SETOF "public"."tabla_1" AS
$body$
declare rs_tabla_1 tabla_1%rowtype;
declare rs_tabla_2 tabla_1%rowtype;
begin
for rs_tabla_1 in
select * from rs_tabla_1 where propietario = aid_usuario and
(tipo = 2 or tipo = 7)
loop
return next rs_tabla_1;
end loop;
for rs_tabla_2 in
select * from rs_tabla_2 where propietario = aid_usuario and tipo
= 9
loop
return next rs_tabla_2;
end loop;
return;
end;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
From | Date | Subject | |
---|---|---|---|
Next Message | Juan Carlos Badillo Goy | 2008-06-20 20:57:42 | Ayuda con una funcion SQL |
Previous Message | Juan Carlos Badillo Goy | 2008-06-20 20:40:43 | Re: Ayuda con una sentencia SQL |