PLPGSQL SETOF functions

Поиск
Список
Период
Сортировка
От David Greco
Тема PLPGSQL SETOF functions
Дата
Msg-id CDFA9340E95A764E9366B4EDF3A43125C8F47A685F@VA3DIAXVS091.RED001.local
обсуждение исходный текст
Ответы Re: PLPGSQL SETOF functions  (Sim Zacks <sim@compulab.co.il>)
Список pgsql-general

I am porting some Oracle code to PLPGSQL and am having a problem with functions that return SETOF datatype. In Oracle, the functions I'm porting return a TABLE of TYPE datatype, this TABLE being itself a named type. I am not aware of how to do this in PLPGSQL.

 

Consider a function with header:

                CREATE OR REPLACE FUNCTION dates_pkg.getbusinessdays(pstartdate timestamp with time zone, penddate timestamp with time zone) RETURNS SETOF timestamp with time zone AS

 

 

I can easily call this function in SQL like so:

                select * from dates_pkg.getbusinessdays( now(), now() + INTERVAL '7' day ) as business_day;

 

However, I can't figure out how to call this function from another plpgsql function. Any hints?

 

~Dave Greco

 

В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Multi-tenancy in Postgres
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: rationale behind quotes for camel case?