Returning function results...

Поиск
Список
Период
Сортировка
От Bob Whitehouse
Тема Returning function results...
Дата
Msg-id 013401c0c9d3$6c187b00$a6a0fea9@amsite.com
обсуждение исходный текст
Список pgsql-novice
How do I return a record to a function?
When I try to add the function below to my database I get this error:
psql:/path/:825: NOTICE: ProcedureCreate: type 'record' is not yet defined

CREATE FUNCTION get_last_respondent(INT4)
       RETURNS RECORD
       AS 'DECLARE
                  int_issue_id_var ALIAS FOR $1;
                  rec_person  RECORD;

           BEGIN
              SELECT h.who, iss.id AS issue, h.id AS histid
              INTO rec_person
              FROM history h, issues iss
              WHERE iss.id = int_issue_id_var
              AND iss.id = h.issue
              AND h.h_type = 3
              AND h.who <> iss.submitter
              ORDER BY histid DESC;

              RETURN rec_person;
       END;'
   LANGUAGE 'plpgsql';

Thanks, Bob


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG ? ... CURSOR AS VIEW ... MOVE ... CRASH
Следующее
От: "Carsten Huettl"
Дата:
Сообщение: postgres installation on FBSD fails