21 November, 2013

Difference between Procedure and Function

Procedure Function
don't need to return value Must return value
stored in DB as compiled statement Parsed and compiled at runtime
can affect state of DB using commit Don't affect state of DB
can not be invoked from sql statement like SELECT can be invoked from sql statement
select max(sal) from Emp
used to perform business logic used to perform computation

No comments:

Post a Comment