Monday, December 20, 2010

Stored Procedures vs fuctions

1) functions are used for computations where as procedures 
can be used for performing business logic.
2) functions MUST return a value, procedures need not be.
3) you can have DML(insert, update, delete) statements in a 
function. But, you cannot call such a function in a SQL 
query..eg: suppose, if u have a function that is updating a 
table.. you can't call that function in any sql query.- 
select myFunction(field) from sometable; will throw error.
4) function parameters are always IN, no OUT is possible

No comments:

Post a Comment