Re: Stored Procedures and Functions

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Stored Procedures and Functions
Дата
Msg-id AFCCBB403D7E7A4581E48F20AF3E5DB203302171@EXADV1.host.magwien.gv.at
обсуждение исходный текст
Ответ на Stored Procedures and Functions  ("Harpreet Dhaliwal" <harpreet.dhaliwal01@gmail.com>)
Список pgsql-general
Harpreet Dhaliwal wrote:

> Is it true that postgres doesn't have a notion of Stored
> Procedures and functions is what it has instead?
> RDBMS like Sql Server supports both stored procedures and functions.
> So I was wondering what is the difference between a Stored
> Procedure and a function.

I think that your questions have not been answered yet.

Yes, it is true, PostgreSQL doesn't have procedures, only functions.

The difference between a function and a procedure is that the former
has a return value, while the latter does not. Procdures can hand back
results via output parameters.

The lack of procedures in PostgreSQL is mitigated by the fact that you
can achieve everything you need with a function:

- If you don't need to return results at all, you define a function
  with return type "void" (which means that nothing is returned).

- If you need to return more than one result, you can define a
  function with a composite return type (or equivalently with
  what PostgreSQL calls "output parameters").

Yours,
Laurenz Albe

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

Предыдущее
От: "Islam Hegazy"
Дата:
Сообщение: Re: debugging C functions
Следующее
От: Klint Gore
Дата:
Сообщение: changing 'mons' in interval?