- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the differences between Stored procedures and functions?
Following are the main differences between functions and procedures:
|A function has a return type and returns a value.||A procedure does not have a return type. But it returns values using the OUT parameters.|
|You cannot use a function with Data Manipulation queries. Only Select queries are allowed in functions.||You can use DML queries such as insert, update, select etc… with procedures.|
|A function does not allow output parameters||A procedure allows both input and output parameters.|
|You cannot manage transactions inside a function.||You can manage transactions inside a procedure.|
|You cannot call stored procedures from a function||You can call a function from a stored procedure.|
|You can call a function using a select statement.||You cannot call a procedure using select statements.|
- Related Articles
- What are the most significant differences between MySQL functions and procedures?
- Writing Functions and Stored Procedures in SQL Server
- What are the special security requirements for using stored procedures and functions together with replication?
- What are stored procedures? How to call stored procedures using JDBC program?
- What are the advantages of stored procedures?
- What are TRIGGERS in DB2? What is the difference between TRIGGERS and STORED PROCEDURES?
- What are Stored procedures in JDBC?
- What are the advantages and disadvantages of using MySQL stored procedures?
- What are recursive stored procedures and why MySQL limits the recursion?
- How can we see the list of stored procedures and stored functions in a particular MySQL database?
- What are the similarities and differences between MySQL ORD() and ASCII() functions?
- What is stored procedure and how can we create MySQL stored procedures?
- What are the limitations for replicating stored procedure and functions?
- What are the differences between short-term and long-term finance functions or decisions?
- What are MySQL stored functions and how can we create them?