Re: return setof record from function with dynamic query

From: Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
To: Toby Tremayne <tobyt(at)toll(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: return setof record from function with dynamic query
Date: 2002-12-18 15:32:29
Message-ID: 20021219002139.56E9.RK73@sea.plala.or.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 18 Dec 2002 17:18:56 +1100
Toby Tremayne <tobyt(at)toll(dot)com(dot)au> wrote:

> ERROR: A column definition list is required for functions returning RECORD
>
> I'd really appreciate it if someone could show me how to pass back
> a set of records please???
>
> Toby
>
> CREATE FUNCTION poptions (INTEGER)
> RETURNS setof record AS '
> DECLARE
> -- parameters
> p_author_id ALIAS FOR $1;
>
> -- local variables
> row_data poem_option_def%ROWTYPE;
> newrows record;

Possibly, Grant's advice will help you. Maybe around the description
of CREATE TYPE.

http://archives.postgresql.org/pgsql-hackers/2002-09/msg01741.php

Regards,
Masaru Sugawara

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Siebert 2002-12-18 15:34:44 To many connections Error
Previous Message Stephan Szabo 2002-12-18 15:21:10 Re: return setof record from function with dynamic query