| From: | Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec> |
|---|---|
| To: | inf200476(at)ucf(dot)edu(dot)cu |
| Cc: | Emanuel Calvo Franco <postgres(dot)arg(at)gmail(dot)com>, pgsql-es-ayuda <pgsql-es-ayuda(at)postgresql(dot)org> |
| Subject: | Re: Ayuda para PL/pgsql |
| Date: | 2009-03-05 04:12:49 |
| Message-ID: | 3073cc9b0903042012x794f7a2bq310ab0e175e72d4f@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-es-ayuda |
2009/3/4 <inf200476(at)ucf(dot)edu(dot)cu>:
>
> probe y me da un erroe en el psql
>
> ERROR: set-valued function called in context that cannot accept a set
> CONTEXTO: PL/pgSQL function "test3" line 5 at return next
>
si pero muestra exactamente "cuando" te da el error, por lo que dices
no queda totalmente claro...
ahora como yo soy adivino y he visto en el pasado se que ese error te
dio al tratar de ejecutar la funcion, probablemente trataste de
ejecutarlo asi: "select test3();" y debiste haberlo hecho asi: "select
* from test3();"
aunque para algo tan simple pudiste haber usado RETURN QUERY como te
indique antes o mejor aun una funcion SQL que quedaria algo asi:
CREATE OR REPLACE FUNCTION test3() RETURNS SETOF data_user_table AS
$$
SELECT * FROM data_user_table ;
$$
LANGUAGE 'sql';
--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ferran Fontcuberta | 2009-03-05 10:53:07 | MERGE (upsert) en postgres? |
| Previous Message | inf200476 | 2009-03-05 03:04:40 | Re: Ayuda para PL/pgsql |