pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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




view thread (4+ messages)  latest in thread

Message-ID: <3EE3B9CC.8060600@joeconway.com>
Permalink:  ../3EE3B9CC.8060600@joeconway.com/
Also on:    postgresql.org/message-id/3EE3B9CC.8060600@joeconway.com

 · 

reply

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