Skip site navigation (1) Skip section navigation (2)

How to use the "setof" of CREATE FUNCTION

From: Fabien Thiriet <fabien(at)freever(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: andre(at)freever(dot)com
Subject: How to use the "setof" of CREATE FUNCTION
Date: 2000-08-30 16:05:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

  I am trying to use the CREATE FUNCTION in order to process multiple
calculation, and forward at the end multiple instances.

This is the SQL statement I am using:

CREATE FUNCTION foo(varchar) RETURNS setof myTable
AS 'UPDATE .......;
SELECT myTable.field2 from myTable'

I always get an error saying that there is a type mismatch between what is
behing the "setof" and what is return by this function (myTable.field2)

Any idea?

(Note: I am using postgresql 7.02)



pgsql-hackers by date

Next:From: Mike MascariDate: 2000-08-30 16:32:45
Subject: Re: Backend-internal SPI operations
Previous:From: Mike MascariDate: 2000-08-30 16:03:15
Subject: Re: Backend-internal SPI operations

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group