Обсуждение: stored procedures

Поиск
Список
Период
Сортировка

stored procedures

От
Shaozhong SHI
Дата:
How easily turn do statement scripts into stored procedures?  Much modification is needed?

What is the advantage to do so?

Regards,

David

Re: stored procedures

От
"David G. Johnston"
Дата:
On Tue, Oct 17, 2023 at 8:54 AM Shaozhong SHI <shishaozhong@gmail.com> wrote:
How easily turn do statement scripts into stored procedures?  Much modification is needed?

What is the advantage to do so?

Depends on the script but possibly a matter of copy-paste for the simplest.

Advantages: The script is on the server, can require permissions, has a name (I suppose a script file does too...).  Easier to deal with input parameters.  Fewer components involved.  Usable by components that can't issue SQL directly - e.g., GraphQL mutations.

Disadvantages: Changing the script is now a formal migration for the database instead of an application update.

David J.