From: Joe Conway <mail@joeconway.com>
To: Mr Weinbach, Larry <larryweinbach@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Using a RETURN NEXT
Date: Sun, 08 Jun 2003 15:33:48 -0700
Message-ID: <3EE3B9CC.8060600@joeconway.com> (raw)
In-Reply-To: <20030606221435.44876.qmail@web12906.mail.yahoo.com>
References: <20030606221435.44876.qmail@web12906.mail.yahoo.com>
Mr Weinbach, Larry wrote:
> But at execution time I am getting thi error :
>
> WARNING: Error occurred while executing PL/pgSQL
> function word_case
> WARNING: line 5 at return next
> ERROR: Set-valued function called in context that
> cannot accept a set
>
You didn't show the execution time SQL statement, but the error you are
getting usually indicates you did something like:
SELECT word_case();
but you should have done:
(define the function to return setof record)
SELECT * FROM word_case() AS (message text);
or
CREATE TYPE word_case_type AS (message text);
(define the function to return setof word_case_type)
SELECT * FROM word_case();
HTH,
Joe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mail@joeconway.com, larryweinbach@yahoo.com
Subject: Re: Using a RETURN NEXT
In-Reply-To: <3EE3B9CC.8060600@joeconway.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox