Re: a column definition list is required for functions returning "record"

From: "Ing(dot) Jhon Carrillo // Caracas, Venezuela" <jhon(dot)carrillo(dot)foros(at)gmail(dot)com>
To: augustin_hm(at)yahoo(dot)es
Cc: Postgresql <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: a column definition list is required for functions returning "record"
Date: 2005-11-30 17:56:32
Message-ID: 84d933650511300956j49ca0563y@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

El 30/11/05, AUGUSTO ESTEBAN<augustin_hm(at)yahoo(dot)es> escribió:
>
> > Saludos, esto asumo que debe ser pichanga para ud.
> > bien soy casi nuevo en esto de plpgsql y tengo el siguiente codigo y
> quiero que me devuelva esa simple consulta(que porsupuesto lo puedo hacer en
> una vist ano ma, pero no se trrata de eso) y me devuelve el siguiente error,
> no me imagino porque, porfavor si alguien me pudiese ayuduar, se lo
> agradeceria.

hola, colocale en la definición en ves de RECORD --> NOTA, a ver que
pasa, es decir

"...RETURNS SETOF NOTA AS
$BODY$
declare
resultado NOTA;..."

suerte

Jhon Carrillo
DBA / Software Engineer
Caracas-Venezuela

> > ----------------------------------------------------------------------
> > -------- ERROR : a column definition list is required for functions
> > returning "record"
> > ----------------------------------------------------------------------
> > -------- CREATE OR REPLACE FUNCTION f_a_prrueba3()
> > RETURNS SETOF record AS
> > $BODY$
> > declare
> > resultado record;
> > begin
> > for resultado in
> > select * from nota
> > loop
> > return next resultado;
> > end loop;
> > return;
> > end;$BODY$
> > LANGUAGE 'plpgsql' VOLATILE;
> > ----------------------------------------------------------------------
> > --------
> > select * from f_a_prrueba3();
> > ----------------------------------------------------------------------
> > --------
> >
> > atte
> >
> > AUGUSTO ESTEBAN HUMIRE MARTINEZ
>
>
>
> ______________________________________________
> Renovamos el Correo Yahoo!
> Nuevos servicios, más seguridad
> http://correo.yahoo.es
>
> ---------------------------(fin del mensaje)---------------------------
> TIP 8: explain analyze es tu amigo
>

--

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message AUGUSTO ESTEBAN 2005-11-30 18:09:32 RV: a column definition list is required for functions returning "record"
Previous Message Jaime Casanova 2005-11-30 17:53:19 Re: a column definition list is required for functions returning "record"