Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  

What is difference between a PROCEDURE & FUNCTION ?



Share on Google+Share on Google+

hemant kumar
What is difference between a PROCEDURE & FUNCTION ?
1 Answer(s)      6 years and 9 months ago
Posted in : SQL

What is difference between a PROCEDURE & FUNCTION ?

View Answers

November 19, 2010 at 5:05 PM


There are the several differences which are as follows-

1-Stored procedure will be used for perform specific tasks and Normally functions will be used for computing value.

2-Stored procedures may or may not return values But function should return value.

3-Stored procedure cannot be used in the select/where/having clause But function can be called from select/where/having clause.

4-Stored procedure can run independently. It can be executed using EXECUTE or EXEC command But function cannot run independently.

5-Temporary table (derived) cannot be created on function But it can be created in stored procedures.

6-Stored procedure can call the user defined functions But the function cannot call the stored procedures.

7-Stored procedures can have input and output parameters But the function can have only input parameters.



Related Tutorials/Questions & Answers: