Re: Using a RETURN NEXT - Mailing list pgsql-sql

From Joe Conway
Subject Re: Using a RETURN NEXT
Date
Msg-id 3EE3B9CC.8060600@joeconway.com
Whole thread Raw
In response to Using a RETURN NEXT  ("Mr Weinbach, Larry" <larryweinbach@yahoo.com>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: "Mr Weinbach, Larry"
Date:
Subject: Using a RETURN NEXT
Next
From: Jan Wieck
Date:
Subject: Re: (long) What's the problem?