From: | "Fernando Aguada" <fernandoaguada(at)yahoo(dot)com(dot)ar> |
---|---|
To: | "Postgresql-es-ayuda" <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Consulta Sobre Funcion |
Date: | 2007-11-07 20:31:05 |
Message-ID: | 002b01c8217d$211bae70$ca00a8c0@FERNANDOA |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Saludos a todos,
mi consulta es existe una manera de hacer la funcion que aparece abajo, sin
utilizar un TIPO fijo, es decir
que cree un tipo cuya estructura sea variable?
no se si me explico, pero adjunto esta simple funcion:
CREATE OR REPLACE FUNCTION padrongral(wforma smallint)
RETURNS SETOF afiliados AS
$BODY$declare rafiliados afiliados%ROWTYPE;
begin
if wforma=01 then
for rafiliados in select cdni,cdeno, caltuom as cfecalt, cempuom as
cempre,
cnuom as cafilia
from afiliados
where cuom=1 and cbajuom='01/01/1900'
loop
return next rafiliados;
end loop;
else
for rafiliados in select cdni, cdeno, caltmut as cfecalt, cempamm as
cempre,
cnume as cafilia
from afiliados
where cmutu=1 and cbajmut='01/01/1900'
loop
return next rafiliados;
end loop;
end if;
end $BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION padrongral(wforma smallint) OWNER TO postgres;
GRANT EXECUTE ON FUNCTION padrongral(wforma smallint) TO public;
GRANT EXECUTE ON FUNCTION padrongral(wforma smallint) TO postgres;
GRANT EXECUTE ON FUNCTION padrongral(wforma smallint) TO operadores;
From | Date | Subject | |
---|---|---|---|
Next Message | KoloSSo | 2007-11-07 20:43:26 | Re: Nuevo release de PostgreSQL |
Previous Message | Brando Torres | 2007-11-07 20:20:09 | RE: Nuevo release de PostgreSQL |