Home » » Differences between Stored Procedures and Functions in MYSQL

Differences between Stored Procedures and Functions in MYSQL

Written By 1 on Friday, May 31, 2013 | 10:36 PM

  • Procedure can return zero or n values whereas function can return one value which is mandatory.
  • Functions can be called from procedure whereas procedures cannot be called from function.
  • Procedures can have input/output parameters for it whereas functions can have only input parameters.
  • Procedure allows select as well as DML statement in it whereas function allows only select statement in it.
  • Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
  • We can go for transaction management in procedure whereas we can't go in function.
  • Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.

    0 Comment:

    Post a Comment