1 . A FUNCTION is always returns a value using the return statement. A PROCEDURE may return one or more values through parameters or may not return at all. 2. Functions are normally used for computations where as procedures are normally used for executing business logic. 3. A Function returns 1 value only. Procedure can return multiple values (max 1024). 4. Stored procedure returns always integer value by default zero. Whereas function returns type could be scalar or table or table values. 5. Stored procedure is precompiled execution plan where as functions are not. 6. A function can call directly by SQL statement like select func_name from dual while procedure cannot. 7.Stored procedure has the security and reduces the network traffic and also we can call stored procedure in any no. of applications at a time. 8. A Function can be used in the SQL Queries while a procedure cannot be used in SQL queries .that cause a major difference b/w function and procedures.
1 . A FUNCTION is always returns a value using the return statement. A PROCEDURE may return one or more values through parameters or may not return at all.
ReplyDelete2. Functions are normally used for computations where as procedures are normally used for executing business logic.
3. A Function returns 1 value only. Procedure can return multiple values (max 1024).
4. Stored procedure returns always integer value by default zero. Whereas function returns type could be scalar or table or table values.
5. Stored procedure is precompiled execution plan where as functions are not.
6. A function can call directly by SQL statement like select func_name from dual while procedure cannot.
7.Stored procedure has the security and reduces the network traffic and also we can call stored procedure in any no. of applications at a time.
8. A Function can be used in the SQL Queries while a procedure cannot be used in SQL queries .that cause a major difference b/w function and procedures.
thank u sir ...
ReplyDelete