1. Functions are compiled and executed at run time.
Stored procedures are stored in parsed and compiled format in the database.
2. Functions cannot affect the state of the database which means we cannot perform insert,delete,update and create operations on the database.
Stored Procedures can affect the state of the database by using insert,delete,update and create operations.
3 Functions are basically used to compute values. We passes some parameters to functions as input and then it performs some operations on the parameter and return output.
Stored procedures are basically used to process the task.
4 Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
5 We can go for transaction management in procedure whereas we can't go in function.
6.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.
7.Function can take only input aurguments, but procedure may take both input and out put parameters.
8 We can call a function from a procedure, but it is not possible to call a procedure from a function
Stored procedures are stored in parsed and compiled format in the database.
2. Functions cannot affect the state of the database which means we cannot perform insert,delete,update and create operations on the database.
Stored Procedures can affect the state of the database by using insert,delete,update and create operations.
3 Functions are basically used to compute values. We passes some parameters to functions as input and then it performs some operations on the parameter and return output.
Stored procedures are basically used to process the task.
4 Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
5 We can go for transaction management in procedure whereas we can't go in function.
6.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.
7.Function can take only input aurguments, but procedure may take both input and out put parameters.
8 We can call a function from a procedure, but it is not possible to call a procedure from a function
No comments:
Post a Comment