What's the differences between stored procedures, functions and routines?

后端 未结 5 1322
礼貌的吻别
礼貌的吻别 2020-12-07 15:34

In MySQL database context, what is the difference among these 3 terms:

  • stored procedure
  • stored function
  • stored routine<
5条回答
  •  [愿得一人]
    2020-12-07 15:55

    Google is your friend. The first match for "mysql routine function procedure" is this: http://dev.mysql.com/doc/refman/5.0/en/stored-routines-syntax.html

    A quick summary:

    A stored routine is either a procedure or a function.

    A procedure is invoked using a CALL statement and can only pass back values using output variables.

    A function can be called from inside a statement just like any other function and can return a scalar value.

提交回复
热议问题