What's the point of a stored procedure?

前端 未结 12 1022
逝去的感伤
逝去的感伤 2021-01-21 12:13

Are they useful for anything outside of a database administrator? If I understand them correctly it\'s merely queries that can be saved directly into MySQL, so it\'d be useless

12条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-21 12:49

    Stored procedures are code that runs on the database server.

    They have a number of uses. Think: If I could run code directly on the database server, what could I use that for?

    Among their many uses, stored procedures can be used to shift some of the processing load to the database server, to reduce network traffic, and to improve security.

    http://en.wikipedia.org/wiki/Stored_procedure

提交回复
热议问题