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

HOWTO return a resultset form SP

From: Thorsten Mauch <mauch(at)imkenberg(dot)de>
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: HOWTO return a resultset form SP
Date: 2001-06-04 20:10:06
Message-ID: E5A63F34D141D111A6F4080009D70ACA0A391C@imkedv_pdc (view raw or flat)
Thread:
Lists: pgsql-novice
Hi All
I tried to write a Stored Procedure that
returns a resultset that contains data of more then
on table.
My prob is that i don't know how to declate the return
type
e.g:
CREATE FUNCTION getoffers()
RETURNS SETOF ??????
AS
'SELECT
persistent.coid,persistent.classname,serviceoffer.range_begin,serviceoffer.r
ange_end,serviceoffer.coid_service,productoffer.coid_price,productoffer.coid
_quantity 
FROM persistent,productoffer,serviceoffer,genericservice WHERE
productoffer.coid=serviceoffer.coid AND serviceoffer.coid=persistent.coid
AND serviceoffer.coid_service=genericservice.coid'
LANGUAGE 'SQL';

Maybe someone can help me ?

Thanx Thorsten

pgsql-novice by date

Next:From: Matteo CentenaroDate: 2001-06-05 11:20:01
Subject: problem with Pl/Pgsql function
Previous:From: Manuel SugawaraDate: 2001-06-04 16:22:50
Subject: Re: Looking for a way to get my time format.

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