What is difference between a PROCEDURE & FUNCTION ?
Editorial / Best Answerkrishnaindia2007
1. Function is mainly used in the case where it must return a value. Where as a procedure may or may not return a value or may return more than one value using the OUT parameter.
2. Function can be called from SQL statements where as procedure can not be called from the sql statements
3. Functions are normally used for computations where as procedures are normally used for executing business logic.
4. You can have DML (insert,update, delete) statements in a function. But, you cannot call such a function in a SQL query.
5. Function returns 1 value only. Procedure can return multiple values (max 1024).
6.Stored Procedure: supports deferred name resolution. Example while writing a stored procedure that uses table named tabl1 and tabl2 etc..but actually not exists in database is allowed only in during creation but runtime throws error Function wont support deferred name resolution.
7.Stored procedure returns always integer value by default zero. where as function return type could be scalar or table or table values
8. Stored procedure is precompiled execution plan where as functions are not.
9.A procedure may modify an object where a function can only return a value The RETURN statement immediately completes the execution of a subprogram and returns control to the caller.
- C program 1-d array
- QTP launch application methods
- Citrix vdi and citrix xendesktop
- Xenapp 6.0 and xenapp 6.5
- What is the difference body & neutral earthing ?
- Adventages of package over standalone procedure
- What are the basic difference between re-insurance and insurance claim handling?
- Business rule & business validation
- What is the difference between subnetmask and host
- What is difference between win XP and win 7
- Launch any application methods in QTP
- What is procedure and package
- Explain how structures can be used with in function
- Microstrategy differences
- What is the difference between a Java developer and Java designer?
- Cash management service
- How to add running totals in report studio
- Is there any difference between web application testing and sharepoint application testing.
- Difference between Informatica 8.1 and 8.6 in briefly