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: 4.1.20000830165557.00c8c100@pop.imaginet.fr (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

  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 .......;
INSERT.......;
SELECT myTable.field2 from myTable'
LANGUAGE 'sql';

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)

Fabien



Responses

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-2014 The PostgreSQL Global Development Group